]> git.phdru.name Git - git-scripts.git/commitdiff
Add scripts to list/show remotes
authorOleg Broytman <phd@phdru.name>
Sun, 5 Jun 2016 11:14:26 +0000 (14:14 +0300)
committerOleg Broytman <phd@phdru.name>
Sun, 5 Jun 2016 11:14:26 +0000 (14:14 +0300)
ls-remotes [new file with mode: 0755]
show-remotes [new file with mode: 0755]
show-remotes-not-synced [new file with mode: 0755]

diff --git a/ls-remotes b/ls-remotes
new file mode 100755 (executable)
index 0000000..5371f6f
--- /dev/null
@@ -0,0 +1,10 @@
+#! /bin/sh
+
+if [ "$1" = "-v" ]; then
+   verbose="--verbose"
+fi
+export verbose
+
+exec "`dirname \"$0\"`"/do-all \
+   'test "$g" = "$d/.git" || continue; cd "$d" &&' \
+   'echo "----- $d -----"; git remote $verbose'
diff --git a/show-remotes b/show-remotes
new file mode 100755 (executable)
index 0000000..1e7a8ee
--- /dev/null
@@ -0,0 +1,10 @@
+#! /bin/sh
+
+if [ "$1" = "-v" ]; then
+   verbose="--verbose"
+fi
+export verbose
+
+exec "`dirname \"$0\"`"/do-all \
+   'test "$g" = "$d/.git" || continue; cd "$d" &&' \
+   'echo "----- $d -----"; git remote | xargs -n1 git remote show'
diff --git a/show-remotes-not-synced b/show-remotes-not-synced
new file mode 100755 (executable)
index 0000000..be4a404
--- /dev/null
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+if [ "$1" = "-v" ]; then
+   verbose="--verbose"
+fi
+export verbose
+
+exec "`dirname \"$0\"`"/do-all \
+   'test "$g" = "$d/.git" || continue; cd "$d" &&' \
+   'not_up="`git remote | xargs -n1 git remote show | ' \
+   'grep -F \" pushes to \" | grep -Fv \"(up to date)\"`" &&' \
+   'test -n "$not_up" && echo "----- $d -----"'