xref: /curl/scripts/contrithanks.sh (revision e358a6e5)
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 <hash> until HEAD and
28# puts them at the end of the THANKS document on stdout
29#
30
31set -eu
32
33start="${1:-}"
34
35if test "$start" = "-h"; then
36  echo "Usage: $0 <since this tag/hash>"
37  exit
38fi
39if test -z "$start"; then
40  start=$(git tag --sort=taggerdate | grep "^curl-" | tail -1)
41fi
42
43# We also include curl-www if possible. Override by setting CURLWWW
44CURLWWW="${CURLWWW:-../curl-www}"
45
46cat ./docs/THANKS
47
48{
49  {
50    git log --use-mailmap "$start..HEAD"
51    if [ -d "$CURLWWW" ]; then
52      git -C "$CURLWWW" log --use-mailmap "$start..HEAD"
53    fi
54  } | \
55  grep -Eai '(^Author|^Commit|by):' | \
56  cut -d: -f2- | \
57  cut '-d(' -f1 | \
58  cut '-d<' -f1 | \
59  tr , '\012' | \
60  sed 's/ at github/ on github/' | \
61  sed 's/ and /\n/' | \
62  sed -e 's/^ //' -e 's/ $//g' -e 's/@users.noreply.github.com$/ on github/'
63
64  # grep out the list of names from RELEASE-NOTES
65  # split on ", "
66  # remove leading whitespace
67  grep -a "^  [^ (]" RELEASE-NOTES| \
68  sed 's/, */\n/g'| \
69  sed 's/^ *//'
70} | \
71sed -f ./docs/THANKS-filter | \
72sort -fu | \
73grep -aixvFf ./docs/THANKS
74