[PATCH/RFC 2/4] git-shell-commands: Add a command to list bare repos
Signed-off-by: Greg Brockman <gdb@mit.edu>
---
git-shell-commands/list | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
create mode 100755 git-shell-commands/list
diff --git a/git-shell-commands/list b/git-shell-commands/list
new file mode 100755
index 0000000..dca2472
--- /dev/null
+++ b/git-shell-commands/list
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+cd "..";
+# TODO: make safe for spaces
+for dir in $(find -type d -name '*.git'); do
+ if [ "$(git --git-dir="$dir" rev-parse --is-bare-repository)" = "true" ]; then
+ echo "${dir#./}"
+ fi
+done
--
1.7.0.4