contrithanks.sh 2.1 KB

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