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