aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Sloughter <[email protected]>2016-11-26 11:09:21 -0800
committerGitHub <[email protected]>2016-11-26 11:09:21 -0800
commitaa37a7c556094c356a719ded1d30f7749a3c11f7 (patch)
treed975ffaf4b81df1886aaac277dc4676e460a452d
parent7df9a08daa96a686f783414b7fc845bb345d0c46 (diff)
parentc55afa51ac129aae6a852f223387072290af436f (diff)
downloadrelx-aa37a7c556094c356a719ded1d30f7749a3c11f7.tar.gz
relx-aa37a7c556094c356a719ded1d30f7749a3c11f7.tar.bz2
relx-aa37a7c556094c356a719ded1d30f7749a3c11f7.zip
Merge pull request #539 from lrascao/feature/add_pr2relnotes_script
Add script to help in generating release changelog
-rwxr-xr-xpr2relnotes.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/pr2relnotes.sh b/pr2relnotes.sh
new file mode 100755
index 0000000..2e78478
--- /dev/null
+++ b/pr2relnotes.sh
@@ -0,0 +1,26 @@
+#!/usr/bin/env sh
+
+if [ -z $1 ]
+then
+ echo "pr2relnotes.sh: prints list of pull requests merged since <tag>"
+ echo " usage: $0 <tag> [pull-request-url (default: https://github.com/erlware/relx/pull/)]"
+ exit 0
+fi
+export url=${2:-"https://github.com/erlware/relx/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"
+ }'