aboutsummaryrefslogtreecommitdiff
path: root/local/hooks/repo-specific/cgit-agefile
diff options
context:
space:
mode:
Diffstat (limited to 'local/hooks/repo-specific/cgit-agefile')
-rwxr-xr-xlocal/hooks/repo-specific/cgit-agefile12
1 files changed, 12 insertions, 0 deletions
diff --git a/local/hooks/repo-specific/cgit-agefile b/local/hooks/repo-specific/cgit-agefile
new file mode 100755
index 0000000..83adfbd
--- /dev/null
+++ b/local/hooks/repo-specific/cgit-agefile
@@ -0,0 +1,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"
+