]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Clean up update authors script
authorJoel Rosdahl <joel@rosdahl.net>
Tue, 21 Apr 2020 18:44:37 +0000 (20:44 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Tue, 21 Apr 2020 18:48:44 +0000 (20:48 +0200)
misc/update_authors.sh

index 3c0e3ab8c207171eeaefb2f43059978a57caf3cd..f108589f79a6d0eff999aed0dddecbcbe9bdfad5 100755 (executable)
@@ -1,12 +1,14 @@
-#!/bin/sh -ex
+#!/bin/sh
 
 if [ -d .git ]; then
-  echo "Updating authors...\n"
+    # Fetch full Git history if needed, e.g. when run via Travis-CI.
+    git fetch --unshallow 2>/dev/null
 
-  # Full git history is needed for this to work
-  # (hide stderr and return code since this fails in case full history is already available)
-  git fetch --unshallow 2> /dev/null || true
-
-  # collect "Co-authored-by" and Authors and update doc/AUTHORS.adoc
-  { git log --pretty=format:"%(trailers)" | grep -Po "(?<=Co-authored-by: )(.*)(?= <)"; git log --format="%aN"; } | sed -e 's/^/* /' | LANG=en_US.utf8 sort -uf | perl -00 -p -i -e 's/^\*.*/<STDIN> . "\n"/es' doc/AUTHORS.adoc
+    # Update doc/AUTHORS.adoc with Git commit authors plus authors mentioned via
+    # a "Co-authored-by:" in the commit message.
+    (git log --pretty=format:"%(trailers)" | grep -Po "(?<=Co-authored-by: )(.*)(?= <)"; \
+     git log --format="%aN") \
+        | sed 's/^/* /' \
+        | LANG=en_US.utf8 sort -uf \
+        | perl -00 -p -i -e 's/^\*.*/<STDIN> . "\n"/es' doc/AUTHORS.adoc
 fi