Skip to content
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

download_strategy: silence detached head warning on git clone #8622

Merged
merged 1 commit into from
Sep 5, 2020

Conversation

dtrodrigues
Copy link
Member

  • 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 style with your changes locally?
  • Have you successfully run brew tests with your changes locally?

Currently, when building a formula from a git repository, a git detached head warning is displayed:

$ rm -rf $(brew --cache)/dive--git && brew install -s dive
==> Cloning https://github.com/wagoodman/dive.git
Cloning into '/Users/username/Library/Caches/Homebrew/dive--git'...
Note: switching to '0872cc18d44a96ed9f59202ac95c556f7e7919a7'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

==> Checking out tag v0.9.2
HEAD is now at 0872cc1 cut release
==> go build -ldflags -s -w -X main.version=0.9.2
...

After the change:

 $ rm -rf $(brew --cache)/dive--git && brew install -s dive
==> Cloning https://github.com/wagoodman/dive.git
Cloning into '/Users/username/Library/Caches/Homebrew/dive--git'...
==> Checking out tag v0.9.2
HEAD is now at 0872cc1 cut release
==> go build -ldflags -s -w -X main.version=0.9.2
...

@maxim-belkin
Copy link
Member

I like the change but I wonder if it should be on a separate line with a comment.

@dtrodrigues dtrodrigues merged commit 03a8522 into Homebrew:master Sep 5, 2020
@MikeMcQuaid
Copy link
Member

Very nice 👏🏻

@dtrodrigues dtrodrigues deleted the silence-detached-head branch September 8, 2020 14:12
@BrewTestBot BrewTestBot added the outdated PR was locked due to age label Dec 13, 2020
@Homebrew Homebrew locked as resolved and limited conversation to collaborators Dec 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants