aboutsummaryrefslogtreecommitdiffstats
path: root/roles/obsd_cgit/files/post-receive.d/cgit
blob: 34bfda476c7a62225571782eb7f4c9cb825188b7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh
set -o errexit
set -o nounset

# $ man cgitrc
# ...
# agefile
#   Specifies a path, relative to each repository path, which can be used
#   to specify the date and time of the youngest commit in the
#   repository. The first line in the file is used as input to the
#   "parse_date" function in libgit. Recommended timestamp-format is
#   "yyyy-mm-dd hh:mm:ss". You may want to generate this file from a
#   post-receive hook. Default value: "info/web/last-modified".
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"