From 4d18ff5dab763b477b5ccf64fee13ba1ac72b8a0 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Sat, 21 Mar 2020 13:40:09 -0700 Subject: [PATCH] Update author generation script to retain existing ones. --- tools/generate-authors.fish | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/tools/generate-authors.fish b/tools/generate-authors.fish index 208d45a..6a638ee 100755 --- a/tools/generate-authors.fish +++ b/tools/generate-authors.fish @@ -5,15 +5,23 @@ echo '# This file lists all individuals having contributed content to the reposi echo '# This list was auto-generated from Git history.' echo -git log --format='%aN <%aE>' | awk ' -{ - pos = index($0, "<"); - name = substr($0, 0, pos - 2); - email = substr($0, pos + 1, length($0) - pos - 1); - names[name]++; - emails[email]++; - if (names[name] == 1 && emails[email] == 1) { - print $0; +function list_authors + # List existing authors + git show HEAD:AUTHORS | sed -e '/^$/d' -e '/^#/d' + + # List any new authors + git log --format='%aN <%aE>' | awk ' + { + pos = index($0, "<"); + name = substr($0, 0, pos - 2); + email = substr($0, pos + 1, length($0) - pos - 1); + names[name]++; + emails[email]++; + if (names[name] == 1 && emails[email] == 1) { + print $0; + } } -} -' | env LC_ALL=C.UTF-8 sort -uf + ' +end + +list_authors | env LC_ALL=C.UTF-8 sort -uf