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) <first_commit_year,
last_commit_year>: Change format to format:%aD, remove --date, supply
output as a -d option argument to date +%Y.
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'