From 54baefda8c0bbee461a4cd68dca970d92fddced0 Mon Sep 17 00:00:00 2001 From: Greg Brockman Date: Wed, 28 Jul 2010 00:43:04 -0700 Subject: 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 Signed-off-by: Junio C Hamano --- contrib/git-shell-commands/list | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 contrib/git-shell-commands/list (limited to 'contrib/git-shell-commands/list') diff --git a/contrib/git-shell-commands/list b/contrib/git-shell-commands/list new file mode 100755 index 000000000..6f8993882 --- /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 -- cgit v1.2.1