aboutsummaryrefslogtreecommitdiff
path: root/sys/contrib/openzfs/scripts/man-dates.sh
blob: 186d94639a5651d2ff2c26365ae936b79731b655 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
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")
    [ "x$git_date" = "x" ] && continue
    sed -i "s|^\.Dd.*|.Dd $(date -d "$git_date" "+%B %-d, %Y")|" "$i"
done