contributors.sh 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. # This script shows all mentioned contributors from the given <hash>/<tag>
  25. # until HEAD and adds the contributors already mentioned in the existing
  26. # RELEASE-NOTES.
  27. #
  28. start=$1
  29. if test "$start" = "-h"; then
  30. echo "Usage: $0 <since this tag/hash> [--releasenotes]"
  31. exit
  32. fi
  33. if test -z "$start"; then
  34. start=`git tag --sort=taggerdate | grep "^curl-" | tail -1`;
  35. echo "Since $start:"
  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. # filter out Author:, Commit: and *by: lines
  42. # cut off the email parts
  43. # split list of names at comma
  44. # split list of names at " and "
  45. # cut off spaces first and last on the line
  46. # filter alternatives through THANKS-filter
  47. # only count names with a space (ie more than one word)
  48. # sort all unique names
  49. # awk them into RELEASE-NOTES format
  50. (
  51. (
  52. git log --pretty=full --use-mailmap $start..HEAD
  53. if [ -d "$CURLWWW" ]
  54. then
  55. git -C ../curl-www log --pretty=full --use-mailmap $start..HEAD
  56. fi
  57. ) | \
  58. egrep -ai '(^Author|^Commit|by):' | \
  59. cut -d: -f2- | \
  60. cut '-d(' -f1 | \
  61. cut '-d<' -f1 | \
  62. tr , '\012' | \
  63. sed 's/ at github/ on github/' | \
  64. sed 's/ and /\n/' | \
  65. sed -e 's/^ //' -e 's/ $//g' -e 's/@users.noreply.github.com$/ on github/'
  66. grep -a "^ [^ \(]" RELEASE-NOTES| \
  67. sed 's/, */\n/g'| \
  68. sed 's/^ *//'
  69. )| \
  70. sed -f ./docs/THANKS-filter | \
  71. grep -a ' ' | \
  72. sort -fu | \
  73. awk '{
  74. num++;
  75. n = sprintf("%s%s%s,", n, length(n)?" ":"", $0);
  76. #print n;
  77. if(length(n) > 77) {
  78. printf(" %s\n", p);
  79. n=sprintf("%s,", $0);
  80. }
  81. p=n;
  82. }
  83. END {
  84. printf(" %s\n", p);
  85. printf(" (%d contributors)\n", num);
  86. }
  87. '