aboutsummaryrefslogtreecommitdiff
path: root/local/hooks/repo-specific/cgit-agefile
blob: babc0b3a93cf0286afdf2c2889cd61916f4dc021 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/execlineb
# Ensure that the idle time on cgit will be accurate to the last commit.
# Ported to execline from <https://git.zx2c4.com/cgit/tree/contrib/hooks/post-receive.agefile>.

backtick -in git_dir { git rev-parse --git-dir }
importas -u git_dir git_dir

define agefile ${git_dir}/info/web/last-modified
importas -u agefile agefile

backtick -in agedir { dirname ${agefile} }
importas -u agedir agedir

if { mkdir -p ${agedir} }
redirfd -w 1 ${agefile}
git for-each-ref --sort=-authordate --count=1 --format='%(authordate:iso8601)'