contributors.sh 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #!/bin/sh
  2. #***************************************************************************
  3. # _ _ ____ _
  4. # Project ___| | | | _ \| |
  5. # / __| | | | |_) | |
  6. # | (__| |_| | _ <| |___
  7. # \___|\___/|_| \_\_____|
  8. #
  9. # Copyright (C) 2013-2018, 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.haxx.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 -z "$start"; then
  30. echo "Usage: $0 <since this tag/hash> [--releasenotes]"
  31. exit
  32. fi
  33. # filter out Author:, Commit: and *by: lines
  34. # cut off the email parts
  35. # split list of names at comma
  36. # split list of names at " and "
  37. # cut off spaces first and last on the line
  38. # filter alternatives through THANKS-filter
  39. # only count names with a space (ie more than one word)
  40. # sort all unique names
  41. # awk them into RELEASE-NOTES format
  42. (
  43. git log --use-mailmap $start..HEAD | \
  44. egrep -ai '(^Author|^Commit|by):' | \
  45. cut -d: -f2- | \
  46. cut '-d(' -f1 | \
  47. cut '-d<' -f1 | \
  48. tr , '\012' | \
  49. sed 's/ at github/ on github/' | \
  50. sed 's/ and /\n/' | \
  51. sed -e 's/^ //' -e 's/ $//g' -e 's/@users.noreply.github.com$/ on github/'
  52. grep -a "^ [^ \(]" RELEASE-NOTES| \
  53. sed 's/, */\n/g'| \
  54. sed 's/^ *//'
  55. )| \
  56. sed -f ./docs/THANKS-filter | \
  57. grep -a ' ' | \
  58. sort -fu | \
  59. awk '{
  60. num++;
  61. n = sprintf("%s%s%s,", n, length(n)?" ":"", $0);
  62. #print n;
  63. if(length(n) > 77) {
  64. printf(" %s\n", p);
  65. n=sprintf("%s,", $0);
  66. }
  67. p=n;
  68. }
  69. END {
  70. printf(" %s\n", p);
  71. printf(" (%d contributors)\n", num);
  72. }
  73. '