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

formula: enable Git repository extension for buildpath/testpath #10149

Closed

Conversation

SeekingMeaning
Copy link
Contributor

  • 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 typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?
  • Have you successfully run brew man locally and committed any changes?

This will allow instances of git rev-parse HEAD to be replaced with buildpath.git_head or testpath.git_head

Note: derived paths such as buildpath.parent.git_head or (testpath/"foobar").git_head won't work as GitRepositoryExtension is only enabled for buildpath and testpath specifically.

References to rev-parse in homebrew-core: https://github.com/Homebrew/homebrew-core/search?q=rev-parse

@BrewTestBot
Copy link
Member

Review period will end on 2020-12-28 at 22:43:39 UTC.

@BrewTestBot BrewTestBot added the waiting for feedback Merging is blocked until sufficient time has passed for review label Dec 25, 2020
return unless git? && Utils::Git.available?

Utils.popen_read("git", "rev-parse", "--short=4", "--verify", "-q", "HEAD", chdir: self).chomp.presence
Utils.popen_read("git", "rev-parse", "--short#{"=" if length.present?}#{length}",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Utils.popen_read("git", "rev-parse", "--short#{"=" if length.present?}#{length}",
Utils.popen_read("git", "rev-parse", "--short#{length.presence&.prepend("=")}",

@reitermarkus
Copy link
Member

reitermarkus commented Dec 26, 2020

This is currently a private API.

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.

👍🏻 from me if/when the docs are updated to clarify this is no longer a private API.

@BrewTestBot BrewTestBot removed the waiting for feedback Merging is blocked until sufficient time has passed for review label Dec 29, 2020
@BrewTestBot
Copy link
Member

Review period ended.

@SeekingMeaning
Copy link
Contributor Author

Closing since it seems strange not to be able to do buildpath.parent.git_head

I think something like Utils.git_head(buildpath.parent) would be more appropriate

@SeekingMeaning SeekingMeaning mentioned this pull request Jan 7, 2021
8 tasks
@BrewTestBot BrewTestBot added the outdated PR was locked due to age label Jan 29, 2021
@Homebrew Homebrew locked as resolved and limited conversation to collaborators Jan 29, 2021
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.

None yet

4 participants