summaryrefslogtreecommitdiff
path: root/git-hooks
diff options
context:
space:
mode:
authorParabola git <git@parabola.nu>2014-12-28 03:38:37 +0000
committerParabola git <git@parabola.nu>2014-12-28 03:38:37 +0000
commit5cc4ed0cf2cde585c4ac3199be59caedb68bef61 (patch)
treecaead3435e004ad41f3deaca97bfa7150570105b /git-hooks
parentae7d155eda43ea467293dcd0b17b5caad0e5341e (diff)
Add a post-receive hook to generate agefiles for cgit
Diffstat (limited to 'git-hooks')
-rwxr-xr-xgit-hooks/post-receive.agefile9
1 files changed, 9 insertions, 0 deletions
diff --git a/git-hooks/post-receive.agefile b/git-hooks/post-receive.agefile
new file mode 100755
index 0000000..91d98ec
--- /dev/null
+++ b/git-hooks/post-receive.agefile
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+agefile="$(git rev-parse --git-dir)"/info/web/last-modified
+
+mkdir -p "$(dirname "$agefile")" &&
+git for-each-ref \
+ --sort=-committerdate --count=1 \
+ --format='%(committerdate:iso8601)' \
+ > "$agefile"