Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 44 lines (38 sloc) 807 Bytes
#!/bin/bash
PROJECT_DIR=`git rev-parse --show-toplevel`
FILES=`git ls-files --modified "$PROJECT_DIR"`
DELETED_FILES=`git ls-files --deleted "$PROJECT_DIR"`
ask() {
file="$1"
git status -s "$file"
echo -n "add, ignore, checkout or quit [A/i/c/q]: "
read name
name=${name:-A}
case "$name" in
"A"|"a")
git add "$file"
;;
"I"|"i")
return
;;
"C"|"c")
git checkout -- "$file"
;;
"Q"|"q")
exit
;;
*)
git add "$file"
;;
esac
}
for file in $FILES; do
clear
deleted_test=`echo $DELETED_FILES | grep -c "$file"`
if [[ deleted_test -gt 0 ]]; then
ask $file
continue
fi
git difftool "$file"
ask $file
done