ambevar-dotfiles/.scripts/git-check

22 lines
368 B
Plaintext
Raw Normal View History

#!/bin/sh
usage () {
cat <<EOF>&2
2013-10-23 10:56:28 +02:00
Usage: ${0##*/} FOLDERS
2016-10-17 18:52:30 +02:00
Chack all FOLDERS for a git repo with non-commited files.
2013-10-23 10:56:28 +02:00
EOF
}
[ $# -eq 0 ] && usage && exit 1
[ "$1" = "-h" ] && usage && exit
[ "$1" = "--" ] && shift
2013-10-23 10:56:28 +02:00
for i; do
2016-10-17 18:52:30 +02:00
cd "$i" || continue
if [ -d ".git" ]; then
LC_ALL=C git status -uno | grep -q "nothing to commit" || echo "$i"
fi
cd - >/dev/null
2013-10-23 10:56:28 +02:00
done