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>
This commit is contained in:
Greg Brockman
2010-07-28 00:43:04 -07:00
committed by Junio C Hamano
parent e69164ddb9
commit 54baefda8c
3 changed files with 46 additions and 0 deletions

10
contrib/git-shell-commands/list Executable file
View File

@ -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