aboutsummaryrefslogtreecommitdiffstats
path: root/roles/git/files/git-shell-commands/list
blob: 47e64e1743f5e0c7b60bf5f1b9d3c0aace9c44c9 (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 ${HOME}/*.git); do
    is_bare_repo=$(git --git-dir="${repo}" rev-parse --is-bare-repository)
    if [ "${is_bare_repo}" = "true" ]; then
        echo "* $(basename ${repo})"
        if [ -e "${PUBLIC}/${repo}" ]; then
                echo "      [public]"
        fi
        if [ -f "${repo}/description" ]; then
                echo "      $(cat ${repo}/description)"
        fi
    fi
done