summaryrefslogtreecommitdiffstats
path: root/gitolite/dotfiles/local/triggers/push
blob: 4a23583ddb5ebd39587b6ad3f3795a0ef8e4a3a2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

[ "$4" = "W" ] || exit 0

cd "$GL_REPO_BASE/$2.git"
head=$(git symbolic-ref HEAD)

if ! [ -f "$head" ]; then
    set -- $(find refs/heads -type f)
    if [ $# -eq 1 ] && git symbolic-ref HEAD "$1" >/dev/null 2>&1; then
        echo "NOTICE: Default branch set to $1" >&2
    else
        echo "WARNING: The default branch is $head, but no such branch exists" >&2
    fi
fi

git log -1 --all --date-order --format=%ci >agefile