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