contributors.sh 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. # cut off spaces first and last on the line
  34. # only count names with a space (ie more than one word)
  35. # sort all unique names
  36. # awk them into RELEASE-NOTES format
  37. git log $start..HEAD | \
  38. egrep '(Author|Commit|by):' | \
  39. cut -d: -f2- | \
  40. cut '-d<' -f1 | \
  41. sed -e 's/^ //' -e 's/ $//g' | \
  42. grep ' ' | \
  43. sort -u |
  44. awk '{
  45. num++;
  46. n = sprintf("%s%s%s,", n, length(n)?" ":"", $0);
  47. #print n;
  48. if(length(n) > 78) {
  49. printf(" %s\n", p);
  50. n=sprintf("%s,", $0);
  51. }
  52. p=n;
  53. }
  54. END {
  55. printf(" %s\n", p);
  56. printf(" (%d contributors)\n", num);
  57. }
  58. '