Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions Library/Homebrew/dev-cmd/bump.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class VersionBumpInfo < T::Struct
switch "--auto",
description: "Read the list of formulae/casks from the tap autobump list.",
hidden: true
switch "--no-autobump",
description: "Ignore formulae/casks in autobump list (official repositories only)."
switch "--formula", "--formulae",
description: "Check only formulae."
switch "--cask", "--casks",
Expand All @@ -54,6 +56,7 @@ class VersionBumpInfo < T::Struct

conflicts "--cask", "--formula"
conflicts "--tap=", "--installed"
conflicts "--tap=", "--no-auto"
conflicts "--eval-all", "--installed"
conflicts "--installed", "--auto"
conflicts "--no-pull-requests", "--open-pr"
Expand All @@ -68,6 +71,14 @@ def run
Homebrew.with_no_api_env do
eval_all = args.eval_all? || Homebrew::EnvConfig.eval_all?

excluded_autobump = []
if args.no_autobump?
excluded_autobump.concat(autobumped_formulae_or_casks(CoreTap.instance)) if eval_all || args.formula?
if eval_all || args.cask?
excluded_autobump.concat(autobumped_formulae_or_casks(CoreCaskTap.instance, casks: true))
end
end

formulae_and_casks = if args.auto?
raise UsageError, "`--formula` or `--cask` must be passed with `--auto`." if !args.formula? && !args.cask?

Expand Down Expand Up @@ -119,6 +130,8 @@ def run
formula_or_cask.respond_to?(:token) ? formula_or_cask.token : formula_or_cask.name
end

formulae_and_casks -= excluded_autobump

if args.repology? && !Utils::Curl.curl_supports_tls13?
begin
ensure_formula_installed!("curl", reason: "Repology queries") unless HOMEBREW_BREWED_CURL_PATH.exist?
Expand Down Expand Up @@ -541,6 +554,19 @@ def synced_with(formula, new_version)

synced_with
end

sig { params(tap: Tap, casks: T::Boolean).returns(T::Array[T.any(Formula, Cask::Cask)]) }
def autobumped_formulae_or_casks(tap, casks: false)
autobump_list = tap.autobump
autobump_list.map do |name|
qualified_name = "#{tap.name}/#{name}"
if casks
Cask::CaskLoader.load(qualified_name)
else
Formulary.factory(qualified_name)
end
end
end
end
end
end
6 changes: 6 additions & 0 deletions Library/Homebrew/sorbet/rbi/dsl/homebrew/dev_cmd/bump.rbi

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions completions/bash/brew
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,7 @@ _brew_bump() {
--full-name
--help
--installed
--no-autobump
--no-fork
--no-pull-requests
--open-pr
Expand Down
1 change: 1 addition & 0 deletions completions/fish/brew.fish
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ __fish_brew_complete_arg 'bump' -l formula -d 'Check only formulae'
__fish_brew_complete_arg 'bump' -l full-name -d 'Print formulae/casks with fully-qualified names'
__fish_brew_complete_arg 'bump' -l help -d 'Show this message'
__fish_brew_complete_arg 'bump' -l installed -d 'Check formulae and casks that are currently installed'
__fish_brew_complete_arg 'bump' -l no-autobump -d 'Ignore formulae/casks in autobump list (official repositories only)'
__fish_brew_complete_arg 'bump' -l no-fork -d 'Don\'t try to fork the repository'
__fish_brew_complete_arg 'bump' -l no-pull-requests -d 'Do not retrieve pull requests from GitHub'
__fish_brew_complete_arg 'bump' -l open-pr -d 'Open a pull request for the new version if none have been opened yet'
Expand Down
3 changes: 2 additions & 1 deletion completions/zsh/_brew
Original file line number Diff line number Diff line change
Expand Up @@ -539,13 +539,14 @@ _brew_bump() {
'--full-name[Print formulae/casks with fully-qualified names]' \
'--help[Show this message]' \
'(--tap --eval-all --auto)--installed[Check formulae and casks that are currently installed]' \
'--no-autobump[Ignore formulae/casks in autobump list (official repositories only)]' \
'--no-fork[Don'\''t try to fork the repository]' \
'(--open-pr)--no-pull-requests[Do not retrieve pull requests from GitHub]' \
'(--no-pull-requests)--open-pr[Open a pull request for the new version if none have been opened yet]' \
'--quiet[Make some output more quiet]' \
'--repology[Use Repology to check for outdated packages]' \
'--start-with[Letter or word that the list of package results should alphabetically follow]' \
'(--installed)--tap[Check formulae and casks within the given tap, specified as user`/`repo]' \
'(--installed --no-auto)--tap[Check formulae and casks within the given tap, specified as user`/`repo]' \
'--verbose[Make some output more verbose]' \
- formula \
'(--cask)--formula[Check only formulae]' \
Expand Down
4 changes: 4 additions & 0 deletions docs/Manpage.md
Original file line number Diff line number Diff line change
Expand Up @@ -2090,6 +2090,10 @@ displays whether a pull request has been opened with the URL.

: Do not retrieve pull requests from GitHub.

`--no-autobump`

: Ignore formulae/casks in autobump list (official repositories only).

`--formula`

: Check only formulae.
Expand Down
5 changes: 4 additions & 1 deletion manpages/brew.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.\" generated by kramdown
.TH "BREW" "1" "March 2025" "Homebrew"
.TH "BREW" "1" "April 2025" "Homebrew"
.SH NAME
brew \- The Missing Package Manager for macOS (or Linux)
.SH "SYNOPSIS"
Expand Down Expand Up @@ -1310,6 +1310,9 @@ Print formulae/casks with fully\-qualified names\.
\fB\-\-no\-pull\-requests\fP
Do not retrieve pull requests from GitHub\.
.TP
\fB\-\-no\-autobump\fP
Ignore formulae/casks in autobump list (official repositories only)\.
.TP
\fB\-\-formula\fP
Check only formulae\.
.TP
Expand Down