You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 line
609 B

7 年之前
  1. #!/usr/bin/env sh
  2. if [ -z $1 ]
  3. then
  4. echo "usage: $0 <tag> [pull-request-url]"
  5. exit 0
  6. fi
  7. export url=${2:-"https://github.com/erlang/rebar3/pull/"}
  8. git log --merges --pretty=medium $1..HEAD | \
  9. awk -v url=$url '
  10. # first line of a merge commit entry
  11. /^commit / {mode="new"}
  12. # merge commit default message
  13. mode=="new" && / +Merge pull request/ {
  14. page_id=substr($4, 2, length($4)-1);
  15. mode="started";
  16. next;
  17. }
  18. # line of content including title
  19. mode=="started" && / [^ ]+/ {
  20. print "- [" substr($0, 5) "](" url page_id ")"; mode="done"
  21. }'