diff --git a/Library/Homebrew/dev-cmd/bump-formula-pr.rb b/Library/Homebrew/dev-cmd/bump-formula-pr.rb index 32e4b52a2b..c16165b88c 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=` `--sha256=` : -#: * `bump-formula-pr` [`--devel`] [`--dry-run`] [`--audit`|`--strict`] `--tag=` `--revision=` : +#: * `bump-formula-pr` [`--devel`] [`--dry-run`] [`--audit`|`--strict`] [`--message=`] `--url=` `--sha256=` : +#: * `bump-formula-pr` [`--devel`] [`--dry-run`] [`--audit`|`--strict`] [`--message=`] `--tag=` `--revision=` : #: Creates a pull request to update the formula with a new url or a new tag. #: #: If a is specified, the 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=` is passed, append 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 51cb543318..7b7251faf7 100644 --- a/docs/brew.1.html +++ b/docs/brew.1.html @@ -469,8 +469,8 @@ for instance, for implementing pre-commit hooks.

Generate a bottle (binary package) from a formula installed with --build-bottle.

-
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

Creates a pull request to update the formula with a new url or a new tag.

+
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 also be specified. A best effort to determine the sha-256 and formula @@ -497,6 +497,9 @@ making the expected file modifications but not taking any git actions.

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 diff --git a/manpages/brew.1 b/manpages/brew.1 index d20d907f41..f51468a7f0 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