Align ask dry-run prompts#22353
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts --ask behavior for install/reinstall/upgrade to use --dry-run-style “Would …” plans, and to only prompt when the plan extends beyond what the user explicitly requested (e.g., dependencies/dependents).
Changes:
- Reworked
Install.ask_formulae/ask_casksoutput to match dry-run-style plans and introduced shared prompt decision logic (ask_prompt_needed?). - Updated
brew install/reinstallto pass explicit flags intoask_formulae(instead of passingargs) and updated CLI help text + specs to match new output. - Updated
brew upgrade --askto decide prompting based on the final dry-run plan vs. requested names, including dependency/dependent-driven plan expansion.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| Library/Homebrew/install.rb | Refactors --ask plan printing and introduces shared prompt gating logic. |
| Library/Homebrew/cmd/install.rb | Uses new ask_formulae signature; --ask help text now references dry-run plan. |
| Library/Homebrew/cmd/reinstall.rb | Uses new ask_formulae signature; --ask help text simplified to dry-run-style description. |
| Library/Homebrew/cmd/upgrade.rb | Adds prompt gating based on planned vs requested upgrades and tracks whether dependencies require prompting. |
| Library/Homebrew/test/cmd/install_spec.rb | Updates expectations to dry-run-style output and adds prompt-rule coverage. |
| Library/Homebrew/test/cmd/reinstall_spec.rb | Updates --ask output expectation to new “Would reinstall …” format. |
| Library/Homebrew/test/cmd/upgrade_spec.rb | Adds coverage that explicitly-named upgrades don’t prompt when nothing else changes the plan. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b845b03 to
b0af8d5
Compare
- Use dry-run-style `--ask` plans for install and reinstall commands. - Make single-package operations proceed without a prompt e.g. if you `brew install foo` and there's no dependencies or dependents to install: just install without the prompt. - Keep prompting when dependencies or dependents change the plan.
b0af8d5 to
49a2911
Compare
p-linnane
approved these changes
May 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
--askplans for install and reinstall commands.brew install fooand there's no dependencies or dependents to install: just install without the prompt.brew lgtm(style, typechecking and tests) with your changes locally?OpenAI Codex 5.5 xhigh with local review and testing.