contrithanks.sh 2.1 KB

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