diff options
| author | Zhiming Wang | 2016-11-15 11:37:49 -0500 |
|---|---|---|
| committer | Zhiming Wang | 2016-11-17 15:29:33 -0500 |
| commit | 67999d75f5724232bbb399a1e0fd7b6699f66b4e (patch) | |
| tree | fbadc324d4b9c422ab1d368dd7865fb773fa555f /Library/Homebrew/dev-cmd | |
| parent | f4f90cad759d8d513227c5498fce5d13ae4d8085 (diff) | |
| download | brew-67999d75f5724232bbb399a1e0fd7b6699f66b4e.tar.bz2 | |
bump-formula-pr: add --message option
For user-supplied PR message.
Diffstat (limited to 'Library/Homebrew/dev-cmd')
| -rw-r--r-- | Library/Homebrew/dev-cmd/bump-formula-pr.rb | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/Library/Homebrew/dev-cmd/bump-formula-pr.rb b/Library/Homebrew/dev-cmd/bump-formula-pr.rb index 32e4b52a2..c16165b88 100644 --- a/Library/Homebrew/dev-cmd/bump-formula-pr.rb +++ b/Library/Homebrew/dev-cmd/bump-formula-pr.rb @@ -1,5 +1,5 @@ -#: * `bump-formula-pr` [`--devel`] [`--dry-run`] [`--audit`|`--strict`] `--url=`<url> `--sha256=`<sha-256> <formula>: -#: * `bump-formula-pr` [`--devel`] [`--dry-run`] [`--audit`|`--strict`] `--tag=`<tag> `--revision=`<revision> <formula>: +#: * `bump-formula-pr` [`--devel`] [`--dry-run`] [`--audit`|`--strict`] [`--message=`<message>] `--url=`<url> `--sha256=`<sha-256> <formula>: +#: * `bump-formula-pr` [`--devel`] [`--dry-run`] [`--audit`|`--strict`] [`--message=`<message>] `--tag=`<tag> `--revision=`<revision> <formula>: #: Creates a pull request to update the formula with a new url or a new tag. #: #: If a <url> is specified, the <sha-256> checksum of the new download must @@ -27,6 +27,9 @@ #: parsed from the url or tag. Note that `--version=0` can be used to delete #: an existing `version` override from a formula if it has become redundant. #: +#: If `--message=`<message> is passed, append <message> to the default PR +#: message. +#: #: Note that this command cannot be used to transition a formula from a #: url-and-sha256 style specification into a tag-and-revision style #: specification, nor vice versa. It must use whichever style specification @@ -259,8 +262,21 @@ module Homebrew remote = Utils.popen_read("hub fork 2>&1")[/fatal: remote (.+) already exists\./, 1] odie "cannot get remote from 'hub'!" if remote.to_s.empty? safe_system "git", "push", "--set-upstream", remote, "#{branch}:#{branch}" - safe_system "hub", "pull-request", "--browse", "-m", - "#{formula.name} #{new_formula_version}#{devel_message}\n\nCreated with `brew bump-formula-pr`." + pr_message = <<-EOS.undent + #{formula.name} #{new_formula_version}#{devel_message} + + Created with `brew bump-formula-pr`. + EOS + user_message = ARGV.value("message") + if user_message + pr_message += <<-EOS.undent + + --- + + #{user_message} + EOS + end + safe_system "hub", "pull-request", "--browse", "-m", pr_message safe_system "git", "checkout", "-" end end |
