diff options
author | Parabola git <git@parabola.nu> | 2014-12-28 03:38:37 +0000 |
---|---|---|
committer | Parabola git <git@parabola.nu> | 2014-12-28 03:38:37 +0000 |
commit | 5cc4ed0cf2cde585c4ac3199be59caedb68bef61 (patch) | |
tree | caead3435e004ad41f3deaca97bfa7150570105b /git-hooks | |
parent | ae7d155eda43ea467293dcd0b17b5caad0e5341e (diff) |
Add a post-receive hook to generate agefiles for cgit
Diffstat (limited to 'git-hooks')
-rwxr-xr-x | git-hooks/post-receive.agefile | 9 |
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" |