8000 Add script to help in generating release changelog by lrascao · Pull Request #539 · erlware/relx · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add script to help in generating release changelog #539

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 26, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions pr2relnotes.sh
Original file line number Diff line number Diff line change
@@ -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"
}'
0