From 6baf2aadb6d1235510cfb9b0212af9b70d0a70dd Mon Sep 17 00:00:00 2001 From: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Date: Tue, 8 Feb 2022 20:02:21 +0800 Subject: [PATCH 1/2] pr-{publish,pull}: autosquash by default This allows dispatching the publish workflow via the GitHub UI to have the exact same behaviour as doing `brew pr-publish`. Closes Homebrew/homebrew-core#94704. --- Library/Homebrew/dev-cmd/pr-publish.rb | 5 +++-- Library/Homebrew/dev-cmd/pr-pull.rb | 10 +++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Library/Homebrew/dev-cmd/pr-publish.rb b/Library/Homebrew/dev-cmd/pr-publish.rb index 7dd4c48d75..405a7f6778 100644 --- a/Library/Homebrew/dev-cmd/pr-publish.rb +++ b/Library/Homebrew/dev-cmd/pr-publish.rb @@ -26,13 +26,14 @@ module Homebrew flag "--branch=", description: "Branch to publish to (default: `master`)." flag "--message=", - depends_on: "--autosquash", description: "Message to include when autosquashing revision bumps, deletions, and rebuilds." flag "--tap=", description: "Target tap repository (default: `homebrew/core`)." flag "--workflow=", description: "Target workflow filename (default: `publish-commit-bottles.yml`)." + conflicts "--no-autosquash", "--message" + named_args :pull_request, min: 1 end end @@ -45,7 +46,7 @@ module Homebrew ref = args.branch || "master" extra_args = [] - extra_args << "--autosquash" unless args.no_autosquash? + extra_args << "--no-autosquash" if args.no_autosquash? extra_args << "--message='#{args.message}'" if args.message.presence dispatch_args = extra_args.join " " diff --git a/Library/Homebrew/dev-cmd/pr-pull.rb b/Library/Homebrew/dev-cmd/pr-pull.rb index 4ebe8aab12..c178221988 100644 --- a/Library/Homebrew/dev-cmd/pr-pull.rb +++ b/Library/Homebrew/dev-cmd/pr-pull.rb @@ -27,12 +27,17 @@ module Homebrew switch "-n", "--dry-run", description: "Print what would be done rather than doing it." switch "--clean", + depends_on: "--no-autosquash", description: "Do not amend the commits from pull requests." switch "--keep-old", description: "If the formula specifies a rebuild version, " \ "attempt to preserve its value in the generated DSL." switch "--autosquash", description: "Automatically reformat and reword commits in the pull request to our "\ + "preferred format.", + replacement: "`--no-autosquash` to opt out" + switch "--no-autosquash", + description: "Skip automatically reformatting and rewording commits in the pull request to our "\ "preferred format." switch "--branch-okay", description: "Do not warn if pulling to a branch besides the repository default (useful for testing)." @@ -45,7 +50,6 @@ module Homebrew flag "--committer=", description: "Specify a committer name and email in `git`'s standard author format." flag "--message=", - depends_on: "--autosquash", description: "Message to include when autosquashing revision bumps, deletions, and rebuilds." flag "--artifact=", description: "Download artifacts with the specified name (default: `bottles`)." @@ -62,7 +66,7 @@ module Homebrew comma_array "--ignore-missing-artifacts=", description: "Comma-separated list of workflows which can be ignored if they have not been run." - conflicts "--clean", "--autosquash" + conflicts "--no-autosquash", "--message" named_args :pull_request, min: 1 end @@ -366,7 +370,7 @@ module Homebrew unless args.no_commit? cherry_pick_pr!(user, repo, pr, path: tap.path, args: args) - if args.autosquash? && !args.dry_run? + if !args.no_autosquash? && !args.dry_run? autosquash!(original_commit, path: tap.path, verbose: args.verbose?, resolve: args.resolve?, reason: args.message) end From c505cd9e8527f80d2f2cbd32c6398f5a46140390 Mon Sep 17 00:00:00 2001 From: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Date: Tue, 8 Feb 2022 20:35:26 +0800 Subject: [PATCH 2/2] docs: fix style The existing title is not in title case according to Vale's reference style guide. --- docs/Adding-Software-to-Homebrew.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/Adding-Software-to-Homebrew.md b/docs/Adding-Software-to-Homebrew.md index 3e2cc83ae8..70665a3aaf 100644 --- a/docs/Adding-Software-to-Homebrew.md +++ b/docs/Adding-Software-to-Homebrew.md @@ -1,4 +1,4 @@ -# Adding Software to Homebrew +# Adding Software To Homebrew Are you missing your favorite software in Homebrew? Then you're the perfect person to resolve this problem. @@ -358,4 +358,3 @@ if you set the variable `HOMEBREW_NO_AUTO_UPDATE` then clean it up with: ```bash unset HOMEBREW_NO_AUTO_UPDATE ``` -