aboutsummaryrefslogtreecommitdiff
path: root/local/hooks/repo-specific/cgit-agefile
blob: 83adfbdd484673900b26d16593e0d65e61305a6e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/sh

# Ensure that the idle time on cgit will be accurate to the last commit.
# Sourced from <https://git.zx2c4.com/cgit/tree/contrib/hooks/post-receive.agefile>
agefile="$(git rev-parse --git-dir)"/info/web/last-modified

mkdir -p "$(dirname "$agefile")" &&
git for-each-ref \
    --sort=-authordate --count=1 \
    --format='%(authordate:iso8601)' \
    >"$agefile"