tizen 2.4 release
[external/curl.git] / contributors.sh
1 #!/bin/sh
2 #***************************************************************************
3 #                                  _   _ ____  _
4 #  Project                     ___| | | |  _ \| |
5 #                             / __| | | | |_) | |
6 #                            | (__| |_| |  _ <| |___
7 #                             \___|\___/|_| \_\_____|
8 #
9 # Copyright (C) 2013-2014, Daniel Stenberg, <daniel@haxx.se>, et al.
10 #
11 # This software is licensed as described in the file COPYING, which
12 # you should have received as part of this distribution. The terms
13 # are also available at http://curl.haxx.se/docs/copyright.html.
14 #
15 # You may opt to use, copy, modify, merge, publish, distribute and/or sell
16 # copies of the Software, and permit persons to whom the Software is
17 # furnished to do so, under the terms of the COPYING file.
18 #
19 # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
20 # KIND, either express or implied.
21 #
22 ###########################################################################
23
24 #
25 # This script shows all mentioned contributors from <hash> until HEAD. To aid
26 # when writing RELEASE-NOTES and THANKS.
27 #
28 # Use --releasenotes to also include the names from the existing RELEASE-NOTES
29 # file, which is handy when we've added names manually in there that should be
30 # included in an updated list.
31 #
32
33 start=$1
34
35 if test -z "$start"; then
36   echo "Usage: $0 <since this tag/hash>"
37 fi
38
39 # filter out Author:, Commit: and *by: lines
40 # cut off the email parts
41 # split list of names at comma
42 # split list of names at " and "
43 # cut off spaces first and last on the line
44 # filter alternatives through THANKS-filter
45 # only count names with a space (ie more than one word)
46 # sort all unique names
47 # awk them into RELEASE-NOTES format
48 (
49 git log $start..HEAD | \
50 egrep -i '(Author|Commit|by):' | \
51 cut -d: -f2- | \
52 cut '-d<' -f1 | \
53 tr , '\012' | \
54 sed 's/ and /\n/' | \
55 sed -e 's/^ //' -e 's/ $//g'
56
57 if echo "$*" | grep -qw -- '--releasenotes';then
58     # if --releasenotes was used
59     # grep out the list of names from RELEASE-NOTES
60     # split on ", "
61     # remove leading white spaces
62 grep "^  [^ ]" RELEASE-NOTES| \
63 sed 's/, */\n/g'| \
64 sed 's/^ *//'
65 fi
66 )| \
67 sed -f ./docs/THANKS-filter | \
68 grep ' ' | \
69 sort -fu | \
70 awk '{
71  num++;
72  n = sprintf("%s%s%s,", n, length(n)?" ":"", $0);
73  #print n;
74  if(length(n) > 78) {
75    printf("  %s\n", p);
76    n=sprintf("%s,", $0);
77  }
78  p=n;
79
80 }
81
82  END {
83    printf("  %s\n", p);
84    printf("  (%d contributors)\n", num);
85  }
86
87 '