diff --git a/Library/Homebrew/dev-cmd/pr-automerge.rb b/Library/Homebrew/dev-cmd/pr-automerge.rb index 5f58d20d02..fc0abab80c 100644 --- a/Library/Homebrew/dev-cmd/pr-automerge.rb +++ b/Library/Homebrew/dev-cmd/pr-automerge.rb @@ -30,6 +30,9 @@ module Homebrew switch "--autosquash", description: "Instruct `brew pr-publish` to automatically reformat and reword commits "\ "in the pull request to our preferred format." + switch "--no-autosquash", + description: "Instruct `brew pr-publish` to skip automatically reformatting and rewording commits "\ + "in the pull request to the preferred format." switch "--ignore-failures", description: "Include pull requests that have failing status checks." @@ -40,6 +43,8 @@ module Homebrew def pr_automerge args = pr_automerge_args.parse + odeprecated "`brew pr-automerge --autosquash`", "`brew pr-automerge`" if args.autosquash? + without_labels = args.without_labels || [ "do not merge", "new formula", @@ -71,7 +76,7 @@ module Homebrew publish_args = ["pr-publish"] publish_args << "--tap=#{tap}" if tap - publish_args << "--autosquash" if args.autosquash? + publish_args << "--no-autosquash" if args.no_autosquash? if args.publish? safe_system HOMEBREW_BREW_FILE, *publish_args, *pr_urls else diff --git a/Library/Homebrew/dev-cmd/pr-publish.rb b/Library/Homebrew/dev-cmd/pr-publish.rb index c13ad95a6d..40d91c1332 100644 --- a/Library/Homebrew/dev-cmd/pr-publish.rb +++ b/Library/Homebrew/dev-cmd/pr-publish.rb @@ -19,6 +19,9 @@ module Homebrew switch "--autosquash", description: "If supported on the target tap, automatically reformat and reword commits "\ "in the pull request to our preferred format." + switch "--no-autosquash", + description: "Skip automatically reformatting and rewording commits in the pull request "\ + "to the preferred format, even if supported on the target tap." flag "--branch=", description: "Branch to publish to (default: `master`)." flag "--message=", @@ -40,8 +43,10 @@ module Homebrew workflow = args.workflow || "publish-commit-bottles.yml" ref = args.branch || "master" + odeprecated "`brew pr-publish --autosquash`", "`brew pr-publish`" if args.autosquash? + extra_args = [] - extra_args << "--autosquash" if args.autosquash? + extra_args << "--autosquash" unless args.no_autosquash? extra_args << "--message='#{args.message}'" if args.message.presence dispatch_args = extra_args.join " "