From: Dmitry V. Levin Date: Thu, 11 Jul 2019 17:51:22 +0000 (+0000) Subject: maint/update_copyright_years.sh: take all commits into account X-Git-Tag: v5.2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f1e4a4f46abd2e933699240a6099a343b6dbd4d4;p=strace maint/update_copyright_years.sh: take all commits into account This helps to avoid accidental shrinking of copyright years range. * maint/update_copyright_years.sh: Take all commits into account to find copyright years of the earliest and the latest commit. --- diff --git a/maint/update_copyright_years.sh b/maint/update_copyright_years.sh index 2a6e5efe..a4f7152b 100755 --- a/maint/update_copyright_years.sh +++ b/maint/update_copyright_years.sh @@ -102,10 +102,10 @@ process_file() continue fi - last_commit_year=$(date -u +%Y -d "$(git log -n1 --format=format:%aD \ - -- "$f")") - first_commit_year=$(date -u +%Y -d "$(git log --reverse --format=format:%aD \ - -- "$f" | head -n 1)") + last_commit_year=$(date -u +%Y -d "@$(git log --format=format:%at -- "$f" | + sort -rn |head -n1)") + first_commit_year=$(date -u +%Y -d "@$(git log --format=format:%at -- "$f" | + sort -n |head -n1)") copyright_year=$(printf '%s' "$copyright_year_raw" | sort -r -n | head -n 1) start_note='from git log'