summaryrefslogtreecommitdiff
path: root/cgit-fix-timestamp-multiple.sh
blob: 2c5bb4276cdc255b7c931a9c0d93576b173c75b4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

root="$(pwd)"

cd "$root"

for each in $(find -name '*.git') # assume no whitespace :D
do
	cd "$each"
	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"
	cd "$root"
done