]> git.phdru.name Git - git-scripts.git/commitdiff
List dirty repositories
authorOleg Broytman <phd@phdru.name>
Sun, 23 Mar 2014 23:02:18 +0000 (03:02 +0400)
committerOleg Broytman <phd@phdru.name>
Sun, 23 Mar 2014 23:02:18 +0000 (03:02 +0400)
List repositories that have modified or untracked files; show status.

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

diff --git a/ls-dirty b/ls-dirty
new file mode 100755 (executable)
index 0000000..e5d64da
--- /dev/null
+++ b/ls-dirty
@@ -0,0 +1,5 @@
+#! /bin/sh
+
+exec "`dirname \"$0\"`"/do-all \
+   'test "$g" = "$d/.git" || continue; cd "$d" &&' \
+   'test -n "`git status -s`" && echo "$d"'
diff --git a/status-dirty b/status-dirty
new file mode 100755 (executable)
index 0000000..c8a199b
--- /dev/null
@@ -0,0 +1,8 @@
+#! /bin/sh
+
+prog_dir=`dirname "$0"`
+for d in `"$prog_dir"/ls-dirty`
+do
+   echo "----- $d -----" && cd "$d" &&
+   git status || exit 1
+done