Skip to content

info: show revision in headline upgrade version - #24271

Merged
MikeMcQuaid merged 1 commit into
Homebrew:mainfrom
HaraldNordgren:info-headline-pkg-version
Oct 16, 2026
Merged

MikeMcQuaid merged 1 commit into
Homebrew:mainfrom
HaraldNordgren:info-headline-pkg-version

Conversation

@HaraldNordgren

@HaraldNordgren HaraldNordgren commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

After a revision bump, the brew info headline drops the revision from the upgrade target, so it looks like an upgrade to the version already installed. It now uses pkg_version, matching the Installed Versions line and what brew upgrade installs.

To reproduce, run brew info git with git 2.56.0 installed (the formula is now revision 1).

Before:

$ brew info git
==> git: 2.56.0 → stable 2.56.0, HEAD
...
==> Installed Versions
git 2.56.0 → 2.56.0_1 (1,734 files, 66.9MB) [Linked]

After:

$ brew info git
==> git: 2.56.0 → stable 2.56.0_1, HEAD
...
==> Installed Versions
git 2.56.0 → 2.56.0_1 (1,734 files, 66.9MB) [Linked]

  • 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.

Claude Code (Claude Opus 5.5) traced the cause, wrote the fix and spec change and drafted this description. Verified with brew typecheck, brew style on the changed files, brew tests --only=cmd/info (the updated spec fails on main and passes with the fix) and the brew info git before/after above, captured on macOS 12.

Summary by CodeRabbit

  • Bug Fixes
    • Corrected formula information when an installed formula shadows the requested formula, so the reported installation status and installed kegs are accurate.
    • Updated outdated-formula headlines to show the installed package version alongside the stable version. This makes the version details shown by the info command clearer when an installed formula is behind the stable release.

@HaraldNordgren
HaraldNordgren marked this pull request as ready for review October 16, 2026 08:22
@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 16495490-52e9-4f32-8a77-e858530c3d30
📥 Commits

Reviewing files that changed from the base of the PR and between b3cb275 and 4cca545.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

info_formula now resolves a shadowing installed formula before calculating installation state. When the formula is installed and outdated, the output uses its package version as the stable version. The headline test now covers a formula with revision 1.

Changes: Formula info display

Layer / File(s) Summary
Installed state and version display
Library/Homebrew/cmd/info.rb, Library/Homebrew/test/cmd/info_spec.rb
info_formula resolves the shadowing installed formula before selecting kegs and calculating installation state. For an installed, outdated formula, the stable version uses the package version. The test checks the headline with installed version 0.1 and stable version 0.1_1.

Priority: ⬇️ Low

Merge Risk: 🔵 Low · up to b3cb2

When an installed formula’s alias target changes, brew info can show the old package revision as the upgrade target even though brew upgrade follows the new target. This is a limited display issue; the upgrade behavior itself is unaffected.

Pre-merge checks: Passed 4
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly identifies the main change: brew info now shows the revision in the headline upgrade version.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b85511a4-cd0e-4df6-8069-6a52fd0dc243
📥 Commits

Reviewing files that changed from the base of the PR and between dbdc9b5 and b3cb275.

📒 Files selected for processing: 2
  • Library/Homebrew/cmd/info.rb
  • Library/Homebrew/test/cmd/info_spec.rb

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Comment thread Library/Homebrew/cmd/info.rb Resolved
- The headline built its upgrade target from `stable.version`, which
  drops the revision, so a revision bump showed as
  `2.56.0 → stable 2.56.0`.
- Use `formula.pkg_version` when outdated to match the Installed
  Versions line and what `brew upgrade` installs.
@HaraldNordgren
HaraldNordgren force-pushed the info-headline-pkg-version branch from b3cb275 to 4cca545 Compare October 16, 2026 08:37

@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 16, 2026
Merged via the queue into Homebrew:main with commit 19fe946 Oct 16, 2026
53 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.

2 participants

⌂ 换网址