summaryrefslogtreecommitdiff
path: root/pr2relnotes.sh
diff options
context:
space:
mode:
authorStuart Thackray <stuart.thackray@gmail.com>2017-01-06 12:57:03 +0200
committerStuart Thackray <stuart.thackray@gmail.com>2017-01-06 12:57:03 +0200
commit71187514dabdd94aa333495d92df84a2e750099f (patch)
tree74e3257522e3c9697a8b3aa1fa3a589d8a3ddf9b /pr2relnotes.sh
parent8fb8a91130e0e5c239bb837b9adc4ad71e5806b8 (diff)
parent91a25c11841314e35b095ea0382867c090616ff1 (diff)
Merged branch master into master
Diffstat (limited to 'pr2relnotes.sh')
-rwxr-xr-xpr2relnotes.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/pr2relnotes.sh b/pr2relnotes.sh
new file mode 100755
index 0000000..28712bb
--- /dev/null
+++ b/pr2relnotes.sh
@@ -0,0 +1,25 @@
+#!/usr/bin/env sh
+
+if [ -z $1 ]
+then
+ echo "usage: $0 <tag> [pull-request-url]"
+ exit 0
+fi
+export url=${2:-"https://github.com/erlang/rebar3/pull/"}
+
+git log --merges --pretty=medium $1..HEAD | \
+awk -v url=$url '
+ # first line of a merge commit entry
+ /^commit / {mode="new"}
+
+ # merge commit default message
+ / +Merge pull request/ {
+ page_id=substr($4, 2, length($4)-1);
+ mode="started";
+ next;
+ }
+
+ # line of content including title
+ mode=="started" && / [^ ]+/ {
+ print "- [" substr($0, 5) "](" url page_id ")"; mode="done"
+ }'