aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike McQuaid2017-10-30 09:39:54 +0000
committerGitHub2017-10-30 09:39:54 +0000
commit6c9ff7f6429aaa5504ea862dc661ecdd5812561a (patch)
tree44f7ce3ad4c9d1c32e01b8068d913c16ca0eceb6
parent7a0fdc3d03e8ee97f49cb0e1f061271c6c492dd4 (diff)
parent6ddf3f8796abc669137e58b4032e2ab9c5d17930 (diff)
downloadbrew-6c9ff7f6429aaa5504ea862dc661ecdd5812561a.tar.bz2
Merge pull request #3398 from MikeMcQuaid/hub-no-browse
bump-formula-pr: add --no-browse option.
-rw-r--r--Library/Homebrew/dev-cmd/bump-formula-pr.rb18
-rw-r--r--docs/Manpage.md4
-rw-r--r--manpages/brew.13
3 files changed, 22 insertions, 3 deletions
diff --git a/Library/Homebrew/dev-cmd/bump-formula-pr.rb b/Library/Homebrew/dev-cmd/bump-formula-pr.rb
index 3fd0d1206..9fe70da6b 100644
--- a/Library/Homebrew/dev-cmd/bump-formula-pr.rb
+++ b/Library/Homebrew/dev-cmd/bump-formula-pr.rb
@@ -29,6 +29,10 @@
#: If `--message=`<message> is passed, append <message> to the default PR
#: message.
#:
+#: If `--no-browse` is passed, don't pass the `--browse` argument to `hub`
+#: which opens the pull request URL in a browser. Instead, output it to the
+#: command line.
+#:
#: 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
@@ -297,13 +301,21 @@ module Homebrew
git_dir = Utils.popen_read("git rev-parse --git-dir").chomp
shallow = !git_dir.empty? && File.exist?("#{git_dir}/shallow")
+ hub_args = []
+ git_final_checkout_args = []
+ if ARGV.include?("--no-browse")
+ git_final_checkout_args << "--quiet"
+ else
+ hub_args << "--browse"
+ end
+
if ARGV.dry_run?
ohai "git fetch --unshallow origin" if shallow
ohai "git checkout --no-track -b #{branch} origin/master"
ohai "git commit --no-edit --verbose --message='#{formula.name} #{new_formula_version}#{devel_message}' -- #{formula.path}"
ohai "hub fork # read $HUB_REMOTE"
ohai "git push --set-upstream $HUB_REMOTE #{branch}:#{branch}"
- ohai "hub pull-request --browse -m '#{formula.name} #{new_formula_version}#{devel_message}'"
+ ohai "hub pull-request #{hub_args.join(" ")} -m '#{formula.name} #{new_formula_version}#{devel_message}'"
ohai "git checkout -"
else
safe_system "git", "fetch", "--unshallow", "origin" if shallow
@@ -328,8 +340,8 @@ module Homebrew
#{user_message}
EOS
end
- safe_system "hub", "pull-request", "--browse", "-m", pr_message
- safe_system "git", "checkout", "-"
+ safe_system "hub", "pull-request", *hub_args, "-m", pr_message
+ safe_system "git", "checkout", *git_final_checkout_args, "-"
end
end
end
diff --git a/docs/Manpage.md b/docs/Manpage.md
index 2fe0016d9..d94cec30a 100644
--- a/docs/Manpage.md
+++ b/docs/Manpage.md
@@ -726,6 +726,10 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note
If `--message=``message` is passed, append `message` to the default PR
message.
+ If `--no-browse` is passed, don't pass the `--browse` argument to `hub`
+ which opens the pull request URL in a browser. Instead, output it to the
+ command line.
+
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 a8dde6102..bf0348658 100644
--- a/manpages/brew.1
+++ b/manpages/brew.1
@@ -757,6 +757,9 @@ If \fB\-\-version=\fR\fIversion\fR is passed, use the value to override the valu
If \fB\-\-message=\fR\fImessage\fR is passed, append \fImessage\fR to the default PR message\.
.
.IP
+If \fB\-\-no\-browse\fR is passed, don\'t pass the \fB\-\-browse\fR argument to \fBhub\fR which opens the pull request URL in a browser\. Instead, output it to the command line\.
+.
+.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