From 923a04eaef39c498b8eed19edddc5fe8b8db9a30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Tue, 20 Nov 2018 12:03:43 +0100 Subject: [PATCH] Improve list-authors.sh to only list new authors --- list-authors.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/list-authors.sh b/list-authors.sh index 3e87326270..852a67308f 100644 --- a/list-authors.sh +++ b/list-authors.sh @@ -12,8 +12,17 @@ rm -f authors.txt langs.txt for file in weblate/*.po; do authors=$(git log $commit..HEAD --date=format:"%Y" --format="%aN <%aE>, %ad." $file | grep -v 'anonymous' | sort -u) if [ ! -z "$authors" ]; then - echo "$file" >> langs.txt - echo -e "\n* $file:\n" >> authors.txt - echo "$authors" >> authors.txt + new_authors="" + while read -r author; do + found=$(grep "$author" $file) + if [ -z "$found" ]; then + new_authors+=$author$'\n' + fi + done <<< "$authors" + if [ ! -z "$new_authors" ]; then + echo "$file" >> langs.txt + echo -e "\n* $file:\n" >> authors.txt + echo "$new_authors" >> authors.txt + fi fi done