• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2#***************************************************************************
3#                                  _   _ ____  _
4#  Project                     ___| | | |  _ \| |
5#                             / __| | | | |_) | |
6#                            | (__| |_| |  _ <| |___
7#                             \___|\___/|_| \_\_____|
8#
9# Copyright (C) 2013-2020, 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 https://curl.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 the given <hash>/<tag>
26# until HEAD and adds the contributors already mentioned in the existing
27# RELEASE-NOTES.
28#
29
30start=$1
31
32if test "$start" = "-h"; then
33    echo "Usage: $0 <since this tag/hash> [--releasenotes]"
34    exit
35fi
36if test -z "$start"; then
37    start=`git tag --sort=taggerdate | grep "^curl-" | tail -1`;
38    echo "Since $start:"
39fi
40
41# We also include curl-www if possible. Override by setting CURLWWW
42if [ -z "$CURLWWW" ] ; then
43    CURLWWW=../curl-www
44fi
45
46# filter out Author:, Commit: and *by: lines
47# cut off the email parts
48# split list of names at comma
49# split list of names at " and "
50# cut off spaces first and last on the line
51# filter alternatives through THANKS-filter
52# only count names with a space (ie more than one word)
53# sort all unique names
54# awk them into RELEASE-NOTES format
55
56(
57 (
58  git log --pretty=full --use-mailmap $start..HEAD
59  if [ -d "$CURLWWW" ]
60  then
61   git -C ../curl-www log --pretty=full --use-mailmap $start..HEAD
62  fi
63 ) | \
64egrep -ai '(^Author|^Commit|by):' | \
65cut -d: -f2- | \
66cut '-d(' -f1 | \
67cut '-d<' -f1 | \
68tr , '\012' | \
69sed 's/ at github/ on github/' | \
70sed 's/ and /\n/' | \
71sed -e 's/^ //' -e 's/ $//g' -e 's/@users.noreply.github.com$/ on github/'
72
73grep -a "^  [^ \(]" RELEASE-NOTES| \
74sed 's/, */\n/g'| \
75sed 's/^ *//'
76
77)| \
78sed -f ./docs/THANKS-filter | \
79grep -a ' ' | \
80sort -fu | \
81awk '{
82 num++;
83 n = sprintf("%s%s%s,", n, length(n)?" ":"", $0);
84 #print n;
85 if(length(n) > 77) {
86   printf("  %s\n", p);
87   n=sprintf("%s,", $0);
88 }
89 p=n;
90
91}
92
93 END {
94   printf("  %s\n", p);
95   printf("  (%d contributors)\n", num);
96 }
97
98'
99