diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2011-06-27 17:11:53 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2011-06-27 17:11:53 +0200 |
commit | 12275564ec48905624a8837d42a1dd4557b8e0de (patch) | |
tree | cb6797a7c9606e6b41dacaa74ed2ab98bee9edd7 /easy_e17.sh | |
parent | 9fb6c9e5c8b506a25d1629b05729e1742314652e (diff) | |
download | bin-12275564ec48905624a8837d42a1dd4557b8e0de.zip bin-12275564ec48905624a8837d42a1dd4557b8e0de.tar.gz |
easy_e17.sh: add .gitignore, clean tree before gitt pull
Diffstat (limited to 'easy_e17.sh')
-rwxr-xr-x | easy_e17.sh | 8 |
1 files changed, 7 insertions, 1 deletions
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 } |