copyright-year-gen: workaround for old git versions

Apply the same treatment to this script as the one in
v4.18-278-g295cf32.

* copyright-year-gen <year>: Change format to format:%cD, remove --date,
supply output as a -d option argument to date +%Y.
This commit is contained in:
Eugene Syromyatnikov 2017-08-27 18:29:05 +02:00
parent 12087b7570
commit f07e8ada33

View File

@ -13,7 +13,7 @@ year=
[ -f "${YEAR_FILE}" ] && year="$(cat "${YEAR_FILE}")"
[ -n "${year}" ] ||
year="$(git show --format=format:%cd --no-patch --date=format:%Y)"
year="$(date +%Y -d "$(git show --format=format:%cD --no-patch)")"
[ -n "${year}" ] || year="${DEFAULT_YEAR}"