git-shell-commands/list

13 lines
319 B
Plaintext
Raw Normal View History

2022-04-02 09:15:10 +00:00
#!/bin/sh
TRASH_DIR='trash'
print_if_bare_repo='
if "$(git --git-dir="$1" rev-parse --is-bare-repository)" = true
then
printf "%s\n %s\n\n" "${1#./}" "$(cat ${1}/description)"
fi
'
find -type d -name "*.git" -not -path "./${TRASH_DIR}/*" -exec sh -c "$print_if_bare_repo" -- \{} \; -prune 2>/dev/null