aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorMike McQuaid2016-11-02 12:00:33 -0400
committerGitHub2016-11-02 12:00:33 -0400
commitb3ef8bd0445a3a3c01879c42bd64d16e1258f893 (patch)
treeaae4c40dbc28526b2618ff973d513bc34d2109b5 /Library/Homebrew
parentdc47fb33640e2da62b42c069375518ee3c1766b9 (diff)
parent9f382bfd538cfdefd17712a19cd426ba4917175e (diff)
downloadbrew-b3ef8bd0445a3a3c01879c42bd64d16e1258f893.tar.bz2
Merge pull request #1369 from MikeMcQuaid/boneyard-reason
boneyard-formula-pr: add reason argument.
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/dev-cmd/boneyard-formula-pr.rb16
1 files changed, 11 insertions, 5 deletions
diff --git a/Library/Homebrew/dev-cmd/boneyard-formula-pr.rb b/Library/Homebrew/dev-cmd/boneyard-formula-pr.rb
index a0739dbe9..487f0c9db 100644
--- a/Library/Homebrew/dev-cmd/boneyard-formula-pr.rb
+++ b/Library/Homebrew/dev-cmd/boneyard-formula-pr.rb
@@ -1,10 +1,12 @@
#: @hide_from_man_page
-#: * `boneyard-formula-pr` [`--dry-run`] [`--local`] <formula-name>:
+#: * `boneyard-formula-pr` [`--dry-run`] [`--local`] [`--reason=<reason>`] <formula-name> :
#: Creates a pull request to boneyard a formula.
#:
#: If `--dry-run` is passed, print what would be done rather than doing it.
#:
#: If `--local` is passed, perform only local operations (i.e. don't push or create PR).
+#:
+#: If `--reason=<reason>` is passed, append this to the commit/PR message.
require "formula"
require "utils/json"
@@ -24,6 +26,7 @@ module Homebrew
def boneyard_formula_pr
local_only = ARGV.include?("--local")
formula = ARGV.formulae.first
+ reason = ARGV.value("reason")
odie "No formula found!" unless formula
formula_relpath = formula.path.relative_path_from(formula.tap.path)
@@ -70,6 +73,9 @@ module Homebrew
end
end
branch = "#{formula.name}-boneyard"
+
+ reason = " because #{reason}" if reason
+
if ARGV.dry_run?
puts "cd #{formula.tap.path}"
puts "git checkout --no-track -b #{branch} origin/master"
@@ -80,7 +86,7 @@ module Homebrew
puts "hub fork"
puts "hub fork (to read $HUB_REMOTE)"
puts "git push $HUB_REMOTE #{branch}:#{branch}"
- puts "hub pull-request -m $'#{formula.name}: migrate to boneyard\\n\\nCreated with `brew boneyard-formula-pr`.'"
+ puts "hub pull-request -m $'#{formula.name}: migrate to boneyard\\n\\nCreated with `brew boneyard-formula-pr`#{reason}.'"
end
else
cd formula.tap.path
@@ -98,7 +104,7 @@ module Homebrew
pr_message = <<-EOS.undent
#{formula.name}: migrate to boneyard
- Created with `brew boneyard-formula-pr`.
+ Created with `brew boneyard-formula-pr`#{reason}.
EOS
pr_url = Utils.popen_read("hub", "pull-request", "-m", pr_message).chomp
end
@@ -120,7 +126,7 @@ module Homebrew
puts "hub fork"
puts "hub fork (to read $HUB_REMOTE)"
puts "git push $HUB_REMOTE #{branch}:#{branch}"
- puts "hub pull-request --browse -m $'#{formula.name}: migrate from #{formula.tap.repo}\\n\\nGoes together with $PR_URL\\n\\nCreated with `brew boneyard-formula-pr`.'"
+ puts "hub pull-request --browse -m $'#{formula.name}: migrate from #{formula.tap.repo}\\n\\nGoes together with $PR_URL\\n\\nCreated with `brew boneyard-formula-pr`#{reason}.'"
end
else
cd boneyard_tap.formula_dir
@@ -144,7 +150,7 @@ module Homebrew
Goes together with #{pr_url}.
- Created with `brew boneyard-formula-pr`.
+ Created with `brew boneyard-formula-pr`#{reason}.
EOS
end
end