Skip to content

fix(brew search): Improve hints for apps migrated within the same tap#21881

Merged
MikeMcQuaid merged 2 commits into
Homebrew:mainfrom
yermulnik:main
Apr 7, 2026
Merged

fix(brew search): Improve hints for apps migrated within the same tap#21881
MikeMcQuaid merged 2 commits into
Homebrew:mainfrom
yermulnik:main

Conversation

@yermulnik
Copy link
Copy Markdown
Contributor


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

Since the #21224 was merged and released via https://github.com/Homebrew/brew/releases/tag/5.0.6, the tap migrations within the same tap are working for the third-party taps. However the same wasn't implemented for brew search which still outputs odd hints for such apps that were migrated from a formula to a cask within the same tap. E.g.:

> brew search tfswitch
[…]
==> Casks
yermulnik/tfswitch-homebrew-tap/tfswitch

If you meant "tfswitch" specifically:
It was migrated from yermulnik/tfswitch-homebrew-tap to tfswitch.
You can access it again by running:
  brew tap tfswitch/
And then you can install it by running:
  brew install tfswitch

This is a follow up to #21207 and attempts to provide a more meaningful and correct hints for apps migrated within the same tap.

Cc @MikeMcQuaid

Copilot AI review requested due to automatic review settings April 1, 2026 12:32
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 PR updates Homebrew’s missing-formula hinting to produce more accurate guidance when a formula has been migrated to a cask within the same tap, improving the brew search/missing formula messaging for third-party taps using tap_migrations.json.

Changes:

  • Add a “same tap” migration path that changes the message and avoids suggesting brew tap … when the migration stays within the same tap.
  • Adjust the suggested install command to use brew install --cask for same-tap formula→cask migrations.
  • Simplify/reshape the output formatting to better fit the new messaging.

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

Comment thread Library/Homebrew/missing_formula.rb
Comment thread Library/Homebrew/missing_formula.rb
@MikeMcQuaid MikeMcQuaid requested a review from cho-m April 1, 2026 13:02
Copy link
Copy Markdown
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @yermulnik! This logic all looks good and makes sense to me and the wording improvements are 😍.

Just requesting @cho-m give it another look as I'm always a bit twitchy about this sort of logic.

Copy link
Copy Markdown
Member

@cho-m cho-m left a comment

Choose a reason for hiding this comment

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

I'm fine with changes.

There are some scenarios that may not be handled ideally, but that also holds for original code so those could be improved later on. For example, it should be possible to do the reverse (cask-to-formula migration). Also I think we do support { "<name>": "<tap-name>" } as an alternative to perform same migration.

DRY-ing the code would help as we duplicate the handling of this in multiple locations.

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Apr 7, 2026
Merged via the queue into Homebrew:main with commit c6c8636 Apr 7, 2026
38 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.

4 participants