]> granicus.if.org Git - strace/commitdiff
maint/update_copyright_years.sh: take all commits into account
authorDmitry V. Levin <ldv@altlinux.org>
Thu, 11 Jul 2019 17:51:22 +0000 (17:51 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Thu, 11 Jul 2019 17:51:22 +0000 (17:51 +0000)
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.

maint/update_copyright_years.sh

index 2a6e5efe196a33bd919076cd2c2edef009e320fb..a4f7152b63bdcba2cb51f4498bff7eba41df922e 100755 (executable)
@@ -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'