Thread (14 messages) flat view 14 messages, 7 authors, 2016-06-15
STALE3735d

[PATCH/RFC 2/4] git-shell-commands: Add a command to list bare repos

From: Greg Brockman <hidden>
Date: 2016-06-15 22:49:07
Subsystem: the rest · Maintainer: Linus Torvalds

Signed-off-by: Greg Brockman <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help