Skip to content

Conversation

@BenMusch
Copy link
Contributor

@BenMusch BenMusch commented Aug 26, 2017

  • 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 for your changes? Here's an example.
  • Have you successfully run brew tests with your changes locally?

Addresses this issue: #3068 by extending a diagnostic check so that it adds a warning to the console if .git/HEAD is not set to /refs/heads/master

Any thoughts on how to test this? Are there patterns established for testing things that interact with the filesystem?

Copy link
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.

Nice work! Just the messaging and a small code tweak and this should be good to go.

end

head = coretap_path.git_head
return unless head && head !~ %r{refs/heads/master}
Copy link
Member

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.

Unless you have compelling reasons, consider setting the head to
point at the master branch by running:
git checkout master
Copy link
Member

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.

@MikeMcQuaid
Copy link
Member

Fantastic work again, @BenMusch! Looking forward already to your next PR 😍

@MikeMcQuaid MikeMcQuaid merged commit db8af67 into Homebrew:master Aug 26, 2017
@BenMusch BenMusch deleted the check-for-branch branch August 26, 2017 13:12
@MikeMcQuaid
Copy link
Member

@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!

@BenMusch
Copy link
Contributor Author

Interesting, will investigate and re-open. Thanks for the heads up @MikeMcQuaid

@ilovezfs
Copy link
Contributor

Thanks, @BenMusch! For what it's worth, I think you need to use --symbolic-full-name.

@Homebrew Homebrew locked and limited conversation to collaborators May 4, 2018
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.

3 participants