Base code merged to SPIN 2.4
[platform/upstream/curl.git] / contributors.sh
index 41f9cb1..cb5a329 100755 (executable)
 # This script shows all mentioned contributors from <hash> until HEAD. To aid
 # when writing RELEASE-NOTES and THANKS.
 #
+# Use --releasenotes to also include the names from the existing RELEASE-NOTES
+# file, which is handy when we've added names manually in there that should be
+# included in an updated list.
+#
 
 start=$1
 
@@ -34,17 +38,35 @@ fi
 
 # filter out Author:, Commit: and *by: lines
 # cut off the email parts
+# split list of names at comma
+# split list of names at " and "
 # cut off spaces first and last on the line
+# filter alternatives through THANKS-filter
 # only count names with a space (ie more than one word)
 # sort all unique names
 # awk them into RELEASE-NOTES format
+(
 git log $start..HEAD | \
-egrep '(Author|Commit|by):' | \
+egrep -i '(Author|Commit|by):' | \
 cut -d: -f2- | \
 cut '-d<' -f1 | \
-sed -e 's/^ //' -e 's/ $//g' | \
+tr , '\012' | \
+sed 's/ and /\n/' | \
+sed -e 's/^ //' -e 's/ $//g'
+
+if echo "$*" | grep -qw -- '--releasenotes';then
+    # if --releasenotes was used
+    # grep out the list of names from RELEASE-NOTES
+    # split on ", "
+    # remove leading white spaces
+grep "^  [^ ]" RELEASE-NOTES| \
+sed 's/, */\n/g'| \
+sed 's/^ *//'
+fi
+)| \
+sed -f ./docs/THANKS-filter | \
 grep ' ' | \
-sort -u |
+sort -fu | \
 awk '{
  num++;
  n = sprintf("%s%s%s,", n, length(n)?" ":"", $0);