-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Add check for HEAD ref in diagnostics #3089
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
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.
Nice work! Just the messaging and a small code tweak and this should be good to go.
Library/Homebrew/diagnostic.rb
Outdated
| end | ||
|
|
||
| head = coretap_path.git_head | ||
| return unless head && head !~ %r{refs/heads/master} |
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.
Don't use unless ... &&; it's hard to follow. Switch to an if.
Library/Homebrew/diagnostic.rb
Outdated
| Unless you have compelling reasons, consider setting the head to | ||
| point at the master branch by running: | ||
| git checkout master |
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.
Replace all the above text with something like:
Homebrew/homebrew-core is not on the master branch
Check out the master branch by running:
git -C "$(brew --repo homebrew/core)" checkout master
Want to avoid Git jargon where possible here.
|
Fantastic work again, @BenMusch! Looking forward already to your next PR 😍 |
|
@BenMusch this had to be reverted unfortunately (see the linked stuff above) but I’d love if you could try again in a new PR and detail what commands you use to test this so we can try them too. Thanks again! |
|
Interesting, will investigate and re-open. Thanks for the heads up @MikeMcQuaid |
|
Thanks, @BenMusch! For what it's worth, I think you need to use |
brew testswith your changes locally?Addresses this issue: #3068 by extending a diagnostic check so that it adds a warning to the console if
.git/HEADis not set to/refs/heads/masterAny thoughts on how to test this? Are there patterns established for testing things that interact with the filesystem?