summaryrefslogtreecommitdiff
path: root/contrib/git-shell-commands/list
diff options
context:
space:
mode:
authorLibravatar Greg Brockman <gdb@MIT.EDU>2010-07-28 00:43:04 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2010-08-12 15:16:31 -0700
commit54baefda8c0bbee461a4cd68dca970d92fddced0 (patch)
tree65d0c395c0bd63da14713a2c3ee3c9d132a48023 /contrib/git-shell-commands/list
parentAdd interactive mode to git-shell for user-friendliness (diff)
downloadtgif-54baefda8c0bbee461a4cd68dca970d92fddced0.tar.xz
Add sample commands for git-shell
Provide a 'list' command to view available bare repositories ending in .git and a 'help command to display usage. Also add documentation in a README Signed-off-by: Greg Brockman <gdb@mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/git-shell-commands/list')
-rwxr-xr-xcontrib/git-shell-commands/list10
1 files changed, 10 insertions, 0 deletions
diff --git a/contrib/git-shell-commands/list b/contrib/git-shell-commands/list
new file mode 100755
index 0000000000..6f89938821
--- /dev/null
+++ b/contrib/git-shell-commands/list
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+print_if_bare_repo='
+ if "$(git --git-dir="$1" rev-parse --is-bare-repository)" = true
+ then
+ printf "%s\n" "${1#./}"
+ fi
+'
+
+find -type d -name "*.git" -exec sh -c "$print_if_bare_repo" -- \{} \; -prune 2>/dev/null