aboutsummaryrefslogtreecommitdiffstats
path: root/roles/git/files/git-shell-commands/list
blob: 297754107b5ce619585f321d06f50273b703f630 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
#
# /usr/local/share/git-core/contrib/git-shell-commands/list
#
# Aaron LI
# 2017-06-19
#

. ${HOME}/vars.conf

for repo in $(ls -d *.git); do
    is_bare_repo=$(git --git-dir="${repo}" rev-parse --is-bare-repository)
    if [ "${is_bare_repo}" = "true" ]; then
        echo "* ${repo}"
        if [ -e "${PUBLIC}/${repo}" ]; then
                echo "      [public]"
        fi
        if [ -f "${repo}/description" ]; then
                echo "      $(cat ${repo}/description)"
        fi
    fi
done