]> git.phdru.name Git - git-scripts.git/commitdiff
List not pushed repositories carefully
authorOleg Broytman <phd@phdru.name>
Tue, 2 Aug 2016 19:55:01 +0000 (22:55 +0300)
committerOleg Broytman <phd@phdru.name>
Tue, 2 Aug 2016 20:04:00 +0000 (23:04 +0300)
Get status without touching the repo (by using a temporary copy).

ls-not-pushed-carefully [new file with mode: 0755]

diff --git a/ls-not-pushed-carefully b/ls-not-pushed-carefully
new file mode 100755 (executable)
index 0000000..29384e7
--- /dev/null
@@ -0,0 +1,12 @@
+#! /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 \
+"$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