xref: /freebsd/sys/contrib/openzfs/scripts/man-dates.sh (revision 7877fdebeeb35fad1cbbafce22598b1bdf97c786)
1#!/bin/sh
2
3# This script updates the date lines in the man pages to the date of the last
4# commit to that file.
5
6set -eu
7
8find man -type f | while read -r i ; do
9    git_date=$(git log -1 --date=short --format="%ad" -- "$i")
10    [ "x$git_date" = "x" ] && continue
11    sed -i "s|^\.Dd.*|.Dd $(date -d "$git_date" "+%B %-d, %Y")|" "$i"
12done
13