From c48617fadacbae620b1b454360948df730a3e250 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Tue, 2 Aug 2016 22:55:01 +0300 Subject: [PATCH] List not pushed repositories carefully Get status without touching the repo (by using a temporary copy). --- ls-not-pushed-carefully | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 ls-not-pushed-carefully diff --git a/ls-not-pushed-carefully b/ls-not-pushed-carefully new file mode 100755 index 0000000..29384e7 --- /dev/null +++ b/ls-not-pushed-carefully @@ -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 -- 2.39.2