-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Hint at new location of migrated formulae #1732
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
97649cc to
07eda2e
Compare
MikeMcQuaid
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like this approach. A few comments but I suspect we'll get this merged soon.
Library/Homebrew/cmd/info.rb
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How long does search_for_migrated_formula take to run? I wonder if we can skip this message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't take long, could be left out. I put it in just so that we print a message for each kind of search.
Library/Homebrew/cmd/install.rb
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How long does search_for_migrated_formula take to run? I wonder if we can skip this message.
Library/Homebrew/migrated.rb
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably worth putting this in Library/Homebrew/migrator.rb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, make print_messages part of an options hash.
Library/Homebrew/migrated.rb
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably want to use EOS.undent and a few lines here. Test on a 80 character wide terminal and see how it looks.
Library/Homebrew/migrated.rb
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
next unless print_messages
|
@zmwangx Ping on these comments. If you don't have the desire/time to address them that's fine and I'll do them inline at some point. |
07eda2e to
f0a2872
Compare
|
@MikeMcQuaid Sorry, I forgot about this. Just addressed most comments. Two outstanding comments:
The difficulty here is that messages could vary in length. I could, sort of, break them like but then it looks weird, especially on a reasonably wide terminal (including a 80-column one). I'd say soft wrap is better than hard wrap here. |
|
Related to this in case it piques your interest is gracefully handling the case where there hasn't been a migration based just on the Git history. Also worth noting #1812 if you haven't seen it already. |
Um, if the formula can't be found and is also not in git history, how do we print anything useful? On the other hand, if something appears in
Thanks for the pointer. Yeah, it would be nice to issue a warning in #1812's case, whether the formula is migrated or not. Not sure what's the right way to issue a warning there though. As long as there's a warning, |
|
By the way, is failing because I wrote module Homebrew
def search_for_migrated_formula
end
endinstead of module Homebrew
def self.search_for_migrated_formula
end
endand the former requires |
Sure. We're planning on removing the boneyard and generally want to handle cases when formulae are deleted rather than migrated better. If I remove
What would you suggest?
Use |
|
Still definitely interested in this PR when you can get it 💚, @zmwangx.
There's logic for this now in #1996 which can either be duped in here or integrated after it's merged. |
00c4b89 to
444d92c
Compare
|
@MikeMcQuaid Sorry, I forgot about this PR again. I just added support for searching for a deleted formula in git history, based on logic very similar to that of #1996. I have renamed Here are some samples (I removed Unfortunately, Smells like a bug in |
|
To answer an earlier question:
Something like "Warning: formula foo not found in any tap / tap blah, loaded from keg instead"? By the way, I'm happy to keep working on this PR, but please feel free to take over at any time if you feel like it. |
Yeh, something like this would be good.
Thanks 👍 |
444d92c to
4d224b6
Compare
|
I've made a bunch of changes here and think it's good to merge. Interested in thoughts from @reitermarkus, @zmwangx and @ilovezfs. Once this is merged I think we can also delete the homebrew/boneyard as the messaging is sufficiently good now. |
d7883db to
640b16c
Compare
|
LGTM. |
Library/Homebrew/missing_formula.rb
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good place for module_function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't get module_function to work with the extend and alias here. I think we tried before on Emoji and gave up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which extend?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, not extend, the require and using macOS specific stuff at the bottom of the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yes.
Library/Homebrew/missing_formula.rb
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe call this blacklist_reason?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:: instead of .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use Formatter.url here, and a period at the end.
Library/Homebrew/missing_formula.rb
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe call this reason?
bea79eb to
349bb6c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:: instead of .
349bb6c to
0ccb8a3
Compare
Partial implementation of https://github.com/Homebrew/brew-evolution/pull/15, along with the ability to search for deleted formulae in git history (inspired by Homebrew#1996) which is not described in the proposal. See also: Homebrew#1371.
This makes it easier to turn an arbitrary path into a tap path.
This wasn’t adapted to the new, multiple repository world.
This will allow extending this class so it can be used by more than just blacklisting.
These methods belong together so combine them in a single class to provide a simpler API.
ecf26e8 to
f59eb35
Compare
|
Thanks for getting this started @zmwangx! |
brew testswith your changes locally?This is a partial implementation of https://github.com/Homebrew/brew-evolution/pull/15. Please read the proposal, which was basically agreed upon. (Note that #1371 was also a step towards the goal.)
With this change:
(
zmwangx/oldhas a placeholdertap_migrations.jsonwith{"aeskeyfind": "zmwangx/new"}.)