summaryrefslogtreecommitdiff
path: root/.config/git/hooks/post-receive.d/agefile
diff options
context:
space:
mode:
Diffstat (limited to '.config/git/hooks/post-receive.d/agefile')
-rwxr-xr-x.config/git/hooks/post-receive.d/agefile9
1 files changed, 9 insertions, 0 deletions
diff --git a/.config/git/hooks/post-receive.d/agefile b/.config/git/hooks/post-receive.d/agefile
new file mode 100755
index 0000000..10fc253
--- /dev/null
+++ b/.config/git/hooks/post-receive.d/agefile
@@ -0,0 +1,9 @@
+#!/bin/bash
+set -x
+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"