From: Eugene Syromyatnikov Date: Fri, 25 Aug 2017 22:28:45 +0000 (+0200) Subject: update_copyright_years.sh: workaround for old git versions X-Git-Tag: v4.19~56 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=v4.18-278-g295cf32;p=strace 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. --- 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'