Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

implements formula search fallback #33648

Closed
wants to merge 1 commit into from

Conversation

mambocab
Copy link
Contributor

This PR addresses #33635. The change: when brew install fails to find a formula, it now searches formula as well as taps.

Current behavior:

$ brew install racket
Error: No available formula for racket
Searching taps...
$ brew search racket
plt-racket

I found myself doing that sort of thing a lot. Now brew install racket does this:

$ brew install racket
Error: No available formula for racket
Searching taps...
Searching formulae...
plt-racket

I could not find documentation for the feature that searches taps after failure to install, which seems like the place to document this feature as well. The same goes for tests. However, in my discussion with @MikeMcQuaid, he indicated tests and documentation might not be necessary for this feature.

@mambocab
Copy link
Contributor Author

Thinking on it harder, the message given by the search fallback is a little verbose now. A better one might be

Searching formulae and taps...
Formulae:
found-formulae
Taps:
tapper/found-tap

with the Formulae: and Taps: headings removed entirely if the no formulae or taps, respectively, were found.

Thoughts? I feel the maintainers should make this kind of message-design decision, not me.

@MikeMcQuaid
Copy link
Member

How long does it take to search the formulae? If it's nearly instant it's probably worth keeping the headings as-is but putting it above the tap output (which will take longer).

@mambocab
Copy link
Contributor Author

It's near-instant on my machine.

So, output should look like this?

Searching formulae...
relevant-formula
Searching taps...
tapper/relevant-tap

And if there are, for instance, no taps, leave the headings in place:

Searching formulae...
relevant-formula
Searching taps...

If I make this change, would you prefer the commits squashed? I know they should be squashed for formulae, but the guide doesn't say for other features.

@MikeMcQuaid
Copy link
Member

Output looks good and yup to squashing. thanks!

@mambocab
Copy link
Contributor Author

Done. The output for brew install racket for this PR is now

Error: No available formula for racket
Searching formulae...
plt-racket
Searching taps...

@MikeMcQuaid: thanks for all the feedback and shepherding!

@MikeMcQuaid
Copy link
Member

@Homebrew/owners Any objections to this going in?

@DomT4
Copy link
Member

DomT4 commented Oct 27, 2014

Not part of Homebrew/owners, but this is absolutely great. Major kudos on this, very clean and very handy.

@MikeMcQuaid
Copy link
Member

Pulled. Great work @mambocab.

@Homebrew Homebrew locked and limited conversation to collaborators Feb 17, 2016
@mambocab mambocab deleted the search-fallback branch June 21, 2016 14:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants