From 12275564ec48905624a8837d42a1dd4557b8e0de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Mon, 27 Jun 2011 17:11:53 +0200 Subject: easy_e17.sh: add .gitignore, clean tree before gitt pull --- easy_e17.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/easy_e17.sh b/easy_e17.sh index 80fcfc5..5068d35 100755 --- a/easy_e17.sh +++ b/easy_e17.sh @@ -791,6 +791,11 @@ function git_fetch () echo "- updating sources in '$src_path' ..." cd $src_path SHA_PREV=$(git log --pretty="format:%H" HEAD~1..) + # checkout modified files !!! + echo "- checkout modified files" + git status -s | grep -e '^ M' | cut -d " " -f 3 | xargs git checkout + echo "- remove untracked files" + git status -s | grep -e '^??' | cut -d " " -f 2 | xargs rm git pull SHA_HEAD=$(git log --pretty="format:%H" HEAD~1..) git show ${SHA_PREV}..${SHA_HEAD} --name-only --pretty="format:" | sort | uniq | grep -v -e '^$' | cut -d " " -f 1 > "$tmp_path/source_update.log" @@ -799,7 +804,8 @@ function git_fetch () echo "- clone sources in '$src_path' ..." cd $src_path/.. git clone $git_url $src_path - touch "$tmp_path/git-clone" "$tmp_path/source_update.log" + cd $src_path && echo -e "*~\n*.o\n.libs\n.deps\n**.cache" > .gitignore && git add .gitignore && git commit -m "add .gitignore" + touch "./git-clone" "./source_update.log" fi } -- cgit v1.1-2-g2b99