summaryrefslogtreecommitdiffstats
path: root/scripts/update_timestamps.sh
blob: d9731d0db93c61a8f5bc0a66a28e2916300251f3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh
#
# (C) Copyright 2022, Alejandro Colomar
# SPDX-License-Identifier:  GPL-3.0-only
#
# Update the timestamp of the manual pages modified since the last git
# tag, with the date of the latest commit that modifies that page.
#
#######################################################################


git diff --name-only $(git describe --abbrev=0)..HEAD \
|while read f; do
	date="$(git log --format=%ci -1 -- $f | cut -f1 -d' ')";

	awk "/^\.TH/ {\$4 = \"$date\"} {print}" <$f \
	|sponge $f;
done;