Update to 7.44.0
[platform/upstream/curl.git] / contributors.sh
index 1052de7..cb5a329 100755 (executable)
@@ -6,7 +6,7 @@
 #                            | (__| |_| |  _ <| |___
 #                             \___|\___/|_| \_\_____|
 #
-# Copyright (C) 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
+# Copyright (C) 2013-2014, Daniel Stenberg, <daniel@haxx.se>, et al.
 #
 # This software is licensed as described in the file COPYING, which
 # you should have received as part of this distribution. The terms
 # 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,13 +38,50 @@ 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);
+ #print n;
+ if(length(n) > 78) {
+   printf("  %s\n", p);
+   n=sprintf("%s,", $0);
+ }
+ p=n;
+
+}
+
+ END {
+   printf("  %s\n", p);
+   printf("  (%d contributors)\n", num);
+ }
+
+'