File tree Expand file tree Collapse file tree 2 files changed +48
-1
lines changed Expand file tree Collapse file tree 2 files changed +48
-1
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ To run the integration tests against an LDAP server:
56
56
This section is for gem maintainers to cut a new version of the gem.
57
57
58
58
* Update lib/net/ldap/version.rb to next version number X.X.X following {semver}(http://semver.org/).
59
- * Update `History.rdoc`. Get latest changes with `git log --oneline vLAST_RELEASE..HEAD | grep Merge `
59
+ * Update `History.rdoc`. Get latest changes with `script/changelog `
60
60
61
61
* On the master branch, run `script/release`
62
62
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ # Usage: script/changelog [-r <repo>] [-b <base>] [-h <head>]
3
+ #
4
+ # repo: BASE string of GitHub REPOsitory url. e.g. "user_or_org/REPOsitory". Defaults to git remote url.
5
+ # base: git ref to compare from. e.g. "v1.3.1". Defaults to latest git tag.
6
+ # head: git ref to compare to. Defaults to "HEAD".
7
+ #
8
+ # Generate a changelog preview from pull requests merged between `base` and
9
+ # `head`.
10
+ #
11
+ # https://github.com/jch/release-scripts/blob/master/changelog
12
+ set -e
13
+
14
+ [ $# -eq 0 ] && set -- --help
15
+ while [[ $# > 1 ]]
16
+ do
17
+ key=" $1 "
18
+ case $key in
19
+ -r|--repo)
20
+ repo=" $2 "
21
+ shift
22
+ ;;
23
+ -b|--base)
24
+ base=" $2 "
25
+ shift
26
+ ;;
27
+ -h|--head)
28
+ head=" $2 "
29
+ shift
30
+ ;;
31
+ * )
32
+ ;;
33
+ esac
34
+ shift
35
+ done
36
+
37
+ repo=" ${repo:- $(git remote -v | grep push | awk ' {print $2}' | cut -d' /' -f4- | sed ' s/\.git//' )} "
38
+ base=" ${base:- $(git tag -l | sort -t. -k 1,1n -k 2,2n -k 3,3n | tail -n 1)} "
39
+ head=" ${head:- HEAD} "
40
+ api_url=" https://api.github.com"
41
+
42
+ # get merged PR's. Better way is to query the API for these, but this is easier
43
+ for pr in $( git log --oneline $base ..$head | grep " Merge pull request" | awk ' {gsub("#",""); print $5}' )
44
+ do
45
+ # frustrated with trying to pull out the right values, fell back to ruby
46
+ curl -s " $api_url /repos/$repo /pulls/$pr " | ruby -rjson -e ' pr=JSON.parse(STDIN.read); puts "* #{pr[%q(title)]} {##{pr[%q(number)]}}[#{pr[%q(html_url)]}]"'
47
+ done
You can’t perform that action at this time.
0 commit comments