aboutsummaryrefslogtreecommitdiff
path: root/sys/contrib/openzfs/scripts/man-dates.sh
diff options
context:
space:
mode:
Diffstat (limited to 'sys/contrib/openzfs/scripts/man-dates.sh')
-rwxr-xr-xsys/contrib/openzfs/scripts/man-dates.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/contrib/openzfs/scripts/man-dates.sh b/sys/contrib/openzfs/scripts/man-dates.sh
new file mode 100755
index 000000000000..39f1b5fb1324
--- /dev/null
+++ b/sys/contrib/openzfs/scripts/man-dates.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# This script updates the date lines in the man pages to the date of the last
+# commit to that file.
+
+set -eu
+
+find man -type f | while read -r i ; do
+ git_date=$(git log -1 --date=short --format="%ad" -- "$i")
+ [ -z "$git_date" ] && continue
+ sed -i "s|^\.Dd.*|.Dd $(date -d "$git_date" "+%B %-d, %Y")|" "$i"
+done