Files
bind9/util/file_year.sh
2012-03-09 16:00:50 -08:00

8 lines
275 B
Bash

#!/bin/sh
# Given a file in the currently checked-out branch of the Git
# repository, find out in what year it was most recently committed.
# Used by merge_copyrights.
rev=`git rev-list HEAD -- "$1" | head -n 1`
git show --pretty=format:%ai $rev | head -n 1 | sed 's;-.*;;'