From 295cf322b17a2e0f46b712d12123c418e294c28b Mon Sep 17 00:00:00 2001 From: Eugene Syromyatnikov Date: Sat, 26 Aug 2017 00:28:45 +0200 Subject: [PATCH] update_copyright_years.sh: workaround for old git versions Old git versions (like the one shipped in Debian 8) do not support setting date format with --date, working this around by processing git log output with date +%Y. * main/update_copyright_years.sh (process_file) : Change format to format:%aD, remove --date, supply output as a -d option argument to date +%Y. --- maint/update_copyright_years.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/maint/update_copyright_years.sh b/maint/update_copyright_years.sh index 74442455..b12566af 100755 --- a/maint/update_copyright_years.sh +++ b/maint/update_copyright_years.sh @@ -111,10 +111,10 @@ process_file() continue fi - last_commit_year=$(git log -n1 --format=format:%ad \ - --date=format:%Y -- "$f") - first_commit_year=$(git log --reverse --format=format:%ad \ - --date=format:%Y -- "$f" | head -n 1) + last_commit_year=$(date +%Y -d "$(git log -n1 --format=format:%aD \ + -- "$f")") + first_commit_year=$(date +%Y -d "$(git log --reverse --format=format:%aD \ + -- "$f" | head -n 1)") copyright_year=$(printf '%s' "$copyright_year_raw" | sort -r -n | head -n 1) start_note='from git log' -- 2.40.0