G
YouTube TikTok Games
Skip to content

info: show install paths and PATH shadowing with --verbose - #24168

Merged
MikeMcQuaid merged 2 commits into
Homebrew:mainfrom
HaraldNordgren:info-verbose-keg-paths
Oct 6, 2026
Merged

MikeMcQuaid merged 2 commits into
Homebrew:mainfrom
HaraldNordgren:info-verbose-keg-paths

Conversation

@HaraldNordgren

@HaraldNordgren HaraldNordgren commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

It was hard for me to actually find the Homebrew paths to run binaries that are shadowed on my PATH. This partly reverses #22241 and #22130.

With --verbose, brew info now shows the Cellar: path of each keg, and lists shadowed executables in the Binaries section, grouped by shadowing directory, instead of as a caveat. Without --verbose, the shadowing warning is no longer shown.

▶ brew info git -v
==> git ✔: stable 2.56.0, HEAD
...
...
==> Installed Kegs and Versions
git ✔ 2.56.0 (1,734 files, 66.9MB) [Linked]
  Cellar: /usr/local/Cellar/git/2.56.0
  Built from source on 2026-10-04 at 17:02:15
...
==> Binaries
git-cvsserver

The following git executables are shadowed by commands in /Users/harald/.local/bin:
git                  git-receive-pack     git-upload-archive   git-upload-pack      scalar
The following git executables are shadowed by commands in /Users/harald/.bun/bin:
git-shell
Running these by name will not invoke the version provided by Homebrew
because the shadowing commands come earlier in your PATH.
Disable this behaviour by setting `HOMEBREW_NO_PATH_SHADOW_CHECK=1`.
Hide these hints with `HOMEBREW_NO_ENV_HINTS=1` (see `man brew`).
==> Caveats
The Tcl/Tk GUIs (e.g. gitk, git-gui) are now in the `git-gui` formula.
Subversion interoperability (git-svn) is now in the `git-svn` formula.

  • Have you followed our Contributing guidelines?
  • Have you checked for other open Pull Requests for the same change?
  • Have you explained what your changes do? Performance claims (e.g. "this is faster") must include brew benchmark results.
  • Have you explained why you'd like these changes included, not just what they do?
  • For bug fixes, have you given step-by-step brew commands to reproduce the bug?
  • Have you written new tests (excluding integration tests)? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) locally?

  • I did not use AI/LLM to create this PR, or I disclosed the tool/model below and reviewed its output; I did not attribute commits to AI and will answer maintainer questions and review comments myself without AI/LLM.

I used Claude Code (Claude Opus 5.5) to write the code, tests and this description.

@HaraldNordgren
HaraldNordgren marked this pull request as ready for review October 5, 2026 12:08
Copilot AI lite review requested due to automatic review settings October 5, 2026 12:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

Moderate issues remain around keg selection, duplicate PATH scans, and directory ordering.

Review effort: Lite
Findings: None

What changed in this PR

Updates verbose brew info output to show installation paths and PATH-shadowed executables.

Changes:

  • Adds formula Prefix: and per-keg Cellar: paths.
  • Groups shadowed executables under Binaries.
  • Updates related info and caveat tests.
File Summary
Library/​Homebrew/​test/​cmd/​info_spec.rb Tests verbose paths and binary output.
Library/​Homebrew/​test/​caveats_spec.rb Tests grouped shadowing behavior.
Library/​Homebrew/​cmd/​info.rb Renders paths and verbose binary details; needs opt-linked keg selection and caching improvements.
Library/​Homebrew/​caveats.rb Formats shadowing output; grouped directories need deterministic sorting.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@MikeMcQuaid MikeMcQuaid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

One tiny nit, otherwise looks good!

Comment thread Library/Homebrew/cmd/info.rb Resolved
@HaraldNordgren
HaraldNordgren force-pushed the info-verbose-keg-paths branch 5 times, most recently from 95de35e to 368c821 Compare October 5, 2026 19:32

@MikeMcQuaid MikeMcQuaid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, almost there, was ready to approve but noticed one more thing.

Comment thread Library/Homebrew/caveats.rb Resolved
@HaraldNordgren
HaraldNordgren force-pushed the info-verbose-keg-paths branch from 368c821 to 7e03d8a Compare October 6, 2026 09:05
- The installed versions section dropped each keg's Cellar path, so
  `brew info` no longer showed where a formula is installed.
- With `--verbose`, show the `Cellar:` path of every installed keg.
- The PATH shadowing caveat repeated the full shadowing path on every
  line, so group shadowed executables under a header naming the
  shadowing directory, in compact columns.
- With `--verbose`, `brew info` already lists executables in the
  `Binaries` section, so show the shadowing there instead of in the
  caveats and drop shadowed executables from the main list.
- `brew install` and `brew info` without `--verbose` still show it as
  a caveat.
@HaraldNordgren
HaraldNordgren force-pushed the info-verbose-keg-paths branch from 7e03d8a to c8d2c65 Compare October 6, 2026 09:15

@MikeMcQuaid MikeMcQuaid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@MikeMcQuaid
MikeMcQuaid added this pull request to the merge queue Oct 6, 2026
Merged via the queue into Homebrew:main with commit 685fcc6 Oct 6, 2026
52 checks passed
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.

3 participants