-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Add flag --overwrite
to brew install
to govern the keg-linking step
#12691
Add flag --overwrite
to brew install
to govern the keg-linking step
#12691
Conversation
Allows you to avoid the `Keg::ConflictError` recommending that you invoke `brew link --overwrite` in scenarios when you know that that's how you'd proceed anyway.
e8a6fa5
to
9b678c3
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.
Makes sense to me. Can you explain the case where you know there will be conflicts that you want to overwrite?
Sure! For the most part, Square engineers can install what they like on their laptops; but we have a Bootstrap script that ensures (forces) you to have Homebrew, Homebrew-installed Git, some SSH configs, and some system Git configs. Currently, we upsert those system Git configs into About 0.5% of engineers running this Bootstrap script have |
…he block in `install_args`
Hmm, a couple of questions from this:
|
In most cases there won't be something to overwrite. When there is, we would like to.
It could! It's a brittler API, though. We'd be scraping the output from On the other hand, supporting Both work, but — if this PR lands — the latter's cleaner for us 😄
We did! We started with |
Cool, thanks for explaining. I'm going to pause this for now; personally I feel like this is stepping into |
Hm. I hadn't thought of But (I might be mistaken) I don't think brew uninstall git
touch "$(brew --prefix)/bin/git"
echo 'brew "homebrew/core/git", link: true' > Brewfile
brew bundle you will still get the error:
It looks like Would it make sense to add support for this second flag in both places? |
Gotcha, my mistake then and I'm happy to merge. |
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.
Thanks again @boblail!
Thanks, @MikeMcQuaid! I appreciate that you maintain Homebrew thoughtfully and critically — the project is undoubtedly better for it! |
@boblail 😊 thanks for the kind words! |
Allows you to avoid the
Keg::ConflictError
recommending that you invokebrew link --overwrite
in scenarios when you know that that's how you'd proceed anyway.brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?I didn't see a test in formula_spec.rb that exercised the
Keg::ConflictError
error — that I could copy and adapt. keg_spec.rb already covers the logic of theoverwrite
option.I validated this change by doing: