Thread (5 messages) flat view 5 messages, 1 author, 2016-06-15
DORMANTno replies

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

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

Signed-off-by: Greg Brockman <redacted>
---
 contrib/git-shell-commands/list |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
 create mode 100755 contrib/git-shell-commands/list
diff --git a/contrib/git-shell-commands/list b/contrib/git-shell-commands/list
new file mode 100755
index 0000000..cd8b15a
--- /dev/null
+++ b/contrib/git-shell-commands/list
@@ -0,0 +1,5 @@
+#!/bin/sh
+set -eu
+
+print_if_bare_repo='[ "$(git --git-dir="$1" rev-parse --is-bare-repository)" = true ] && echo "${1#./}"'
+find -type d -name "*.git" -exec sh -c "$print_if_bare_repo" -- \{} \; -prune
-- 
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