Skip to content

update-report: warn about branches after report - #24486

Merged
MikeMcQuaid merged 1 commit into
mainfrom
branch-warning-after-update-report
Nov 5, 2026
Merged

MikeMcQuaid merged 1 commit into
mainfrom
branch-warning-after-update-report

Conversation

@HaraldNordgren

Copy link
Copy Markdown
Member

On a feature branch, brew upgrade printed this, and it looked like being on a branch was why there were no changes:

==> Auto-updated Homebrew!
==> Updated Homebrew from 6ceeda0fc6 to 8b0b7e4419.
Warning: Homebrew/brew is on branch 'multiline-warning-spacing'
No changes to formulae or casks.

The two are unrelated. The warning from #24421 is about the Homebrew/brew repository and the last line is the formula and cask report, which prints the same on main.

This prints the branch warnings after the report, so nothing follows them that looks like a consequence:

==> Auto-updated Homebrew!
==> Updated Homebrew from 7.0.11 (6ceeda0fc6) to 7.0.12 (8b0b7e4419).
No changes to formulae or casks.
Warning: Homebrew/brew is on branch 'branch-warning-after-update-report'

The wording is unchanged and they still only print when the upstream branch moved. They stay above the blank line that ends an auto-update's report, which moves below them. With HOMEBREW_DISABLE_LOAD_FORMULA set, update-report returns before reaching them, so the Homebrew/brew warning no longer prints there, matching the tap warnings.

To reproduce:

  1. brew developer on
  2. cd "$(brew --repository)" && git switch -c my-branch origin/main~10 && git branch -f main origin/main~10
  3. brew update

  • 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) wrote the change and its specs and verified them. Both new specs fail without the change and pass with it. It ran brew update-report --auto-update in a terminal with the before and after revisions set to confirm the order above and ran brew lgtm, which passes.


- The branch warning came straight before the formula and cask report,
  which then read as its consequence although they are unrelated
- Keep the warnings above the blank line ending an auto-update's report
@coderabbitai

coderabbitai Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Bug Fixes
    • Branch-status warnings now appear after the update report, including when Homebrew itself is already up to date.
    • Auto-update output no longer includes an unnecessary blank line when no update was made.

The update report now runs Homebrew and installed Git tap branch checks after its output logic, including when no revision update occurred. Auto-update mode prints a blank line only when an update occurred. New tests check the output order for Homebrew and tap branch warnings.

Changes: Update report behaviour

Layer / File(s) Summary
Report output and branch checks
Library/Homebrew/cmd/update-report.rb, Library/Homebrew/test/cmd/update-report_spec.rb
Branch checks now run after the report output logic. The auto-update blank line is conditional on an update. Tests cover the warning order when there are no reported updates.
Merge Risk: Minimal · up to 7e837

The warning-order change has no identified merge-blocking issue.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: moving branch warnings after the update report.
Description check Passed The description explains the user-facing problem, the intended output order, reproduction steps, test coverage, and verification results. It is directly related to the changeset.
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.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 80cf38ab-c46a-4f39-a05c-a99fa5458365
Commits

Reviewing files that changed from the base of the PR and between 8b0b7e4 and 7e83712.

Files selected for processing: 2
  • Library/Homebrew/cmd/update-report.rb
  • Library/Homebrew/test/cmd/update-report_spec.rb

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

@HaraldNordgren
HaraldNordgren requested a review from dduugg November 5, 2026 14:28

@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 Nov 5, 2026
Merged via the queue into main with commit 7161b70 Nov 5, 2026
56 checks passed
@MikeMcQuaid
MikeMcQuaid deleted the branch-warning-after-update-report branch November 5, 2026 16:03
@msystemsuser

Copy link
Copy Markdown

Following up on the review Harald OK'd by email.

update-report.rb: the Homebrew/brew branch warning now runs after return if Homebrew::EnvConfig.disable_load_formula? (line 239). Before this change it ran above that return, so with HOMEBREW_DISABLE_LOAD_FORMULA set, a Homebrew/brew checkout left on a branch that didn't get the update no longer shows Homebrew/brew is on branch '…'. The tap warnings were already below that return, so only the Homebrew/brew one changed. This is narrow, since that variable is mostly set in CI. One fix would be to run the branch warnings before taking that early return.

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

⌂ 换网址