]> git.phdru.name Git - git-scripts.git/blobdiff - ls-not-pushed-carefully
pull-usrlocalsrc: add git-remote-hg to PATH
[git-scripts.git] / ls-not-pushed-carefully
index 29384e703fcb77289e2b7097b6ff992f6c39e88d..266e4cad675142c627edd96827d703c6817c3f5b 100755 (executable)
@@ -1,12 +1,14 @@
 #! /bin/sh
 
-cd "`dirname \"$0\"`" && PROG_DIR="`pwd`" &&
-cd "$HOME"/tmp && rm -rf ls-not-pushed-carefully.tmp &&
+LSTMP="$HOME"/tmp/ls-not-pushed-carefully.tmp
+export LSTMP
+trap 'exec rm -rf "$LSTMP"' 0 HUP INT QUIT TERM
 
-LSTMP="$HOME"/tmp/ls-not-pushed-carefully.tmp \
-"$PROG_DIR"/do-all \
+cd "`dirname \"$0\"`" && prog_dir="`pwd`" &&
+rm -rf "$LSTMP" && mkdir "$LSTMP" &&
+
+"$prog_dir"/do-all \
    'test "$g" = "$d/.git" || continue;' \
    'rsync -aW --del --protocol=28 "$d" "$LSTMP" && cd "$LSTMP/$b" &&' \
-   'test -n "`git status -b | grep "ahead\|behind"`" && echo "$d"' &&
-
-cd "$HOME"/tmp && exec rm -rf ls-not-pushed-carefully.tmp
+   'test -n "`git status --branch --short | grep "ahead\|behind"`" &&
+   echo "$d"'