diff options
author | Alejandro Colomar <alx.manpages@gmail.com> | 2022-06-08 14:12:43 +0200 |
---|---|---|
committer | Alejandro Colomar <alx.manpages@gmail.com> | 2022-06-08 14:14:24 +0200 |
commit | c19823788268f524ad3745759f7f5cb20b0bec53 (patch) | |
tree | 85ee4de69ac6b9cd47432d76d72935b319404e29 /scripts | |
parent | 17411a0f7b3148ec39aac8f12ee77f2118ac7e80 (diff) |
update_timestamps.sh: Add script to update the pages' timestamps
This differs from what was being done until now. Before, we were
updating the timestamp with the date of the release, but that's
unnecessarily unprecise. With this, we have the actual date of
when the last change was committed.
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/update_timestamps.sh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/scripts/update_timestamps.sh b/scripts/update_timestamps.sh new file mode 100755 index 000000000..d9731d0db --- /dev/null +++ b/scripts/update_timestamps.sh @@ -0,0 +1,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; |