From 4f4448c514e9831120efb3f4073e3edf195c62b8 Mon Sep 17 00:00:00 2001 From: Thierry Moisan Date: Sun, 5 Sep 2021 13:41:15 -0400 Subject: [PATCH 1/2] bump-revision: add --write switch --- Library/Homebrew/dev-cmd/bump-revision.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/dev-cmd/bump-revision.rb b/Library/Homebrew/dev-cmd/bump-revision.rb index 727eb968b3..01eb0ba9c6 100644 --- a/Library/Homebrew/dev-cmd/bump-revision.rb +++ b/Library/Homebrew/dev-cmd/bump-revision.rb @@ -18,9 +18,13 @@ module Homebrew EOS switch "-n", "--dry-run", description: "Print what would be done rather than doing it." + switch "--write-only", + description: "Make the expected file modifications without taking any Git actions." flag "--message=", description: "Append to the default commit message." + conflicts "--dry-run", "--write-only" + named_args :formula, min: 1 end end @@ -62,7 +66,7 @@ module Homebrew message = "#{formula.name}: revision bump #{args.message}" if args.dry_run? ohai "git commit --no-edit --verbose --message=#{message} -- #{formula.path}" - else + elsif !args.write_only? formula.path.parent.cd do safe_system "git", "commit", "--no-edit", "--verbose", "--message=#{message}", "--", formula.path From 58ddea028bda33bf470f081faa86f04f25305498 Mon Sep 17 00:00:00 2001 From: Thierry Moisan Date: Wed, 8 Sep 2021 11:13:46 -0400 Subject: [PATCH 2/2] cli/args.rbi: add write_only? --- Library/Homebrew/cli/args.rbi | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Library/Homebrew/cli/args.rbi b/Library/Homebrew/cli/args.rbi index 80e172e8d8..004dc2fb22 100644 --- a/Library/Homebrew/cli/args.rbi +++ b/Library/Homebrew/cli/args.rbi @@ -290,6 +290,9 @@ module Homebrew sig { returns(T.nilable(T::Array[String])) } def groups; end + + sig { returns(T::Boolean) } + def write_only?; end end end end