aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Library/Homebrew/dev-cmd/bump-formula-pr.rb24
-rw-r--r--docs/brew.1.html7
-rw-r--r--manpages/brew.17
3 files changed, 30 insertions, 8 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
diff --git a/docs/brew.1.html b/docs/brew.1.html
index 51cb54331..7b7251faf 100644
--- a/docs/brew.1.html
+++ b/docs/brew.1.html
@@ -469,8 +469,8 @@ for instance, for implementing pre-commit hooks.</p></dd>
<p>Generate a bottle (binary package) from a formula installed with
<code>--build-bottle</code>.</p></dd>
-<dt><code>bump-formula-pr</code> [<code>--devel</code>] [<code>--dry-run</code>] [<code>--audit</code>|<code>--strict</code>] <code>--url=</code><var>url</var> <code>--sha256=</code><var>sha-256</var> <var>formula</var>:</dt><dd><p></p></dd>
-<dt><code>bump-formula-pr</code> [<code>--devel</code>] [<code>--dry-run</code>] [<code>--audit</code>|<code>--strict</code>] <code>--tag=</code><var>tag</var> <code>--revision=</code><var>revision</var> <var>formula</var></dt><dd><p>Creates a pull request to update the formula with a new url or a new tag.</p>
+<dt><code>bump-formula-pr</code> [<code>--devel</code>] [<code>--dry-run</code>] [<code>--audit</code>|<code>--strict</code>] [<code>--message=</code><var>message</var>] <code>--url=</code><var>url</var> <code>--sha256=</code><var>sha-256</var> <var>formula</var>:</dt><dd><p></p></dd>
+<dt><code>bump-formula-pr</code> [<code>--devel</code>] [<code>--dry-run</code>] [<code>--audit</code>|<code>--strict</code>] [<code>--message=</code><var>message</var>] <code>--tag=</code><var>tag</var> <code>--revision=</code><var>revision</var> <var>formula</var></dt><dd><p>Creates a pull request to update the formula with a new url or a new tag.</p>
<p>If a <var>url</var> is specified, the <var>sha-256</var> checksum of the new download must
also be specified. A best effort to determine the <var>sha-256</var> and <var>formula</var>
@@ -497,6 +497,9 @@ making the expected file modifications but not taking any git actions.</p>
parsed from the url or tag. Note that <code>--version=0</code> can be used to delete
an existing <code>version</code> override from a formula if it has become redundant.</p>
+<p>If <code>--message=</code><var>message</var> is passed, append <var>message</var> to the default PR
+message.</p>
+
<p>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
diff --git a/manpages/brew.1 b/manpages/brew.1
index d20d907f4..f51468a7f 100644
--- a/manpages/brew.1
+++ b/manpages/brew.1
@@ -654,11 +654,11 @@ If \fB\-\-display\-filename\fR is passed, every line of output is prefixed with
Generate a bottle (binary package) from a formula installed with \fB\-\-build\-bottle\fR\.
.
.TP
-\fBbump\-formula\-pr\fR [\fB\-\-devel\fR] [\fB\-\-dry\-run\fR] [\fB\-\-audit\fR|\fB\-\-strict\fR] \fB\-\-url=\fR\fIurl\fR \fB\-\-sha256=\fR\fIsha\-256\fR \fIformula\fR:
+\fBbump\-formula\-pr\fR [\fB\-\-devel\fR] [\fB\-\-dry\-run\fR] [\fB\-\-audit\fR|\fB\-\-strict\fR] [\fB\-\-message=\fR\fImessage\fR] \fB\-\-url=\fR\fIurl\fR \fB\-\-sha256=\fR\fIsha\-256\fR \fIformula\fR:
.
.TP
-\fBbump\-formula\-pr\fR [\fB\-\-devel\fR] [\fB\-\-dry\-run\fR] [\fB\-\-audit\fR|\fB\-\-strict\fR] \fB\-\-tag=\fR\fItag\fR \fB\-\-revision=\fR\fIrevision\fR \fIformula\fR
+\fBbump\-formula\-pr\fR [\fB\-\-devel\fR] [\fB\-\-dry\-run\fR] [\fB\-\-audit\fR|\fB\-\-strict\fR] [\fB\-\-message=\fR\fImessage\fR] \fB\-\-tag=\fR\fItag\fR \fB\-\-revision=\fR\fIrevision\fR \fIformula\fR
Creates a pull request to update the formula with a new url or a new tag\.
.
.IP
@@ -689,6 +689,9 @@ If \fB\-\-mirror=\fR\fIurl\fR is passed, use the value as a mirror url\.
If \fB\-\-version=\fR\fIversion\fR is passed, use the value to override the value parsed from the url or tag\. Note that \fB\-\-version=0\fR can be used to delete an existing \fBversion\fR override from a formula if it has become redundant\.
.
.IP
+If \fB\-\-message=\fR\fImessage\fR is passed, append \fImessage\fR to the default PR message\.
+.
+.IP
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 the preexisting formula already uses\.
.
.TP