]> git.phdru.name Git - git-scripts.git/commitdiff
Carefully list dirty repos and show their status
authorOleg Broytman <phd@phdru.name>
Wed, 27 Jan 2016 21:53:48 +0000 (00:53 +0300)
committerOleg Broytman <phd@phdru.name>
Wed, 27 Jan 2016 21:53:48 +0000 (00:53 +0300)
Copy every repo to a temp directory; this is very slow but prevents
``git status`` from touching real files.

ls-dirty-carefully [new file with mode: 0755]
status-dirty-carefully [new file with mode: 0755]

diff --git a/ls-dirty-carefully b/ls-dirty-carefully
new file mode 100755 (executable)
index 0000000..f723fd0
--- /dev/null
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+cd "`dirname \"$0\"`" && PROG_DIR="`pwd`" &&
+cd "$HOME"/tmp && rm -rf ls-dirty-carefully.tmp &&
+
+LSTMP="$HOME"/tmp/ls-dirty-carefully.tmp \
+"$PROG_DIR"/do-all \
+   'test "$g" = "$d/.git" || continue;' \
+   'rsync -aW --protocol=28 "$d" "$LSTMP" && cd "$LSTMP/$b" &&' \
+   'test -n "`git status -s`" && echo "$d"' &&
+
+cd "$HOME"/tmp && exec rm -rf ls-dirty-carefully.tmp
diff --git a/status-dirty-carefully b/status-dirty-carefully
new file mode 100755 (executable)
index 0000000..bdbf901
--- /dev/null
@@ -0,0 +1,13 @@
+#! /bin/sh
+
+cd "`dirname \"$0\"`" && PROG_DIR="`pwd`" &&
+cd "$HOME"/tmp && rm -rf status-dirty-carefully.tmp &&
+
+LSTMP="$HOME"/tmp/status-dirty-carefully.tmp \
+"$PROG_DIR"/do-all \
+   'test "$g" = "$d/.git" || continue;' \
+   'rsync -aW --protocol=28 "$d" "$LSTMP" && cd "$LSTMP/$b" &&' \
+   'test -n "`git status -s`" && echo "----- $d -----" &&' \
+   'git status --branch' &&
+
+cd "$HOME"/tmp && exec rm -rf status-dirty-carefully.tmp