contributors.sh 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #!/bin/sh
  2. #***************************************************************************
  3. # _ _ ____ _
  4. # Project ___| | | | _ \| |
  5. # / __| | | | |_) | |
  6. # | (__| |_| | _ <| |___
  7. # \___|\___/|_| \_\_____|
  8. #
  9. # Copyright (C) 2013-2014, 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 http://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 <hash> until HEAD. To aid
  25. # when writing RELEASE-NOTES and THANKS.
  26. #
  27. start=$1
  28. if test -z "$start"; then
  29. echo "Usage: $0 <since this tag/hash>"
  30. fi
  31. # filter out Author:, Commit: and *by: lines
  32. # cut off the email parts
  33. # split list of names at comma
  34. # cut off spaces first and last on the line
  35. # only count names with a space (ie more than one word)
  36. # filter alternatives through THANKS-filter
  37. # sort all unique names
  38. # awk them into RELEASE-NOTES format
  39. git log $start..HEAD | \
  40. egrep -i '(Author|Commit|by):' | \
  41. cut -d: -f2- | \
  42. cut '-d<' -f1 | \
  43. tr , '\012' | \
  44. sed -e 's/^ //' -e 's/ $//g' | \
  45. grep ' ' | \
  46. sed -f ./docs/THANKS-filter | \
  47. sort -fu | \
  48. awk '{
  49. num++;
  50. n = sprintf("%s%s%s,", n, length(n)?" ":"", $0);
  51. #print n;
  52. if(length(n) > 78) {
  53. printf(" %s\n", p);
  54. n=sprintf("%s,", $0);
  55. }
  56. p=n;
  57. }
  58. END {
  59. printf(" %s\n", p);
  60. printf(" (%d contributors)\n", num);
  61. }
  62. '