Skip to content

Show install status in which-formula#22300

Open
MikeMcQuaid wants to merge 1 commit into
mainfrom
which-formula-install-status
Open

Show install status in which-formula#22300
MikeMcQuaid wants to merge 1 commit into
mainfrom
which-formula-install-status

Conversation

@MikeMcQuaid
Copy link
Copy Markdown
Member

Fixes #22282

While we're here:

  • Help users identify already-installed providers in command searches
  • Share executables.txt fetching and parsing across Bash commands
  • Keep Bash formatting helpers aligned with their Ruby counterparts

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them? Performance claims (e.g. "this is faster") must include Hyperfine benchmarks.
  • Have you written new tests (excluding integration tests) for your changes? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) with your changes locally?

  • AI was used to generate or assist with generating this PR. Please specify below how you used AI to help you, and what steps you have taken to manually verify the changes. Non-maintainers may only have one AI-assisted/generated PR open at a time.

OpenAI Codex 5.5 xhigh with local review.


Copilot AI review requested due to automatic review settings May 16, 2026 11:06
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request updates brew which-formula to display whether matching provider formulae are installed, and refactors shared Bash helpers so multiple commands can reuse common API/executables-db logic and consistent output formatting.

Changes:

  • Add install-status rendering to which-formula output (with emoji or text labels depending on HOMEBREW_NO_EMOJI).
  • Extract shared Bash helpers into utils.sh (output/formatting) plus utils/api.sh and utils/executables.sh (executables.txt download + parsing).
  • Update brew update and brew exec to reuse the shared executables database logic and announce executables.txt downloads.

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Library/Homebrew/utils/wrapper.sh Switches helper sourcing from removed utils/helpers.sh to new utils.sh.
Library/Homebrew/utils/tty.sh Adds Bash TTY/color detection + columns() helper.
Library/Homebrew/utils/tty.rb Adds cross-reference comment for Bash columns().
Library/Homebrew/utils/ruby.sh Updates sourcing to utils.sh for brew/odie helpers.
Library/Homebrew/utils/output.rb Adds “keep in sync” comments for Bash output/formatting parity.
Library/Homebrew/utils/helpers.sh Removes legacy Bash helper file (superseded by utils.sh + subhelpers).
Library/Homebrew/utils/formatter.sh Adds Bash formatting helpers (headline, bold, label coloring).
Library/Homebrew/utils/formatter.rb Adds cross-reference comments for Bash formatter helpers.
Library/Homebrew/utils/executables.sh Centralizes executables.txt caching/downloading and matching logic.
Library/Homebrew/utils/api.sh Introduces shared API URL/curlrc/time-cond helpers for Bash.
Library/Homebrew/utils.sh New consolidated Bash helpers (ohai/opoo/onoe/odie, pretty status, shims).
Library/Homebrew/test/cmd/which-formula_spec.rb Updates integration expectations to include install status + adds download announcement test.
Library/Homebrew/test/cmd/update_spec.rb Refactors test setup for new utils layout and adds executables.txt announcement test.
Library/Homebrew/list.sh Updates to source utils.sh (for columns, ohai, etc.).
Library/Homebrew/extend/kernel.rb Adds cross-reference comment for Bash which().
Library/Homebrew/cmd/which-formula.sh Uses shared executables helpers and prints install status per formula.
Library/Homebrew/cmd/update.sh Reuses shared API helpers, sources executables helpers, and announces executables.txt fetches.
Library/Homebrew/cmd/setup-ruby.sh Updates to source utils.sh.
Library/Homebrew/cmd/exec.sh Uses shared executables helpers instead of sourcing which-formula script.
Library/Homebrew/brew.sh Switches global helper sourcing from utils/helpers.sh to utils.sh.
AGENTS.md Documents convention for keeping mirrored Bash/Ruby logic in sync with two-way comments.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Library/Homebrew/test/cmd/which-formula_spec.rb Outdated
- Help users identify already-installed providers in command searches
- Preserve plain formula output for non-TTY consumers
- Share `executables.txt` fetching and parsing across Bash commands
- Keep Bash formatting helpers aligned with their Ruby counterparts
- Limit added integration coverage to core command behaviour
- Avoid creating repo-root `Cellar` in command specs
@MikeMcQuaid MikeMcQuaid force-pushed the which-formula-install-status branch from 9c97983 to 28c3a66 Compare May 16, 2026 11:19
@MikeMcQuaid MikeMcQuaid enabled auto-merge May 16, 2026 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

which-formula: show installation status

2 participants