-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Conversation
Review period will end on 2020-12-28 at 22:43:39 UTC. |
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}", |
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.
Utils.popen_read("git", "rev-parse", "--short#{"=" if length.present?}#{length}", | |
Utils.popen_read("git", "rev-parse", "--short#{length.presence&.prepend("=")}", |
This is currently a private API. |
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.
👍🏻 from me if/when the docs are updated to clarify this is no longer a private API.
Review period ended. |
Closing since it seems strange not to be able to do I think something like |
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?brew man
locally and committed any changes?This will allow instances of
git rev-parse HEAD
to be replaced withbuildpath.git_head
ortestpath.git_head
Note: derived paths such as
buildpath.parent.git_head
or(testpath/"foobar").git_head
won't work asGitRepositoryExtension
is only enabled forbuildpath
andtestpath
specifically.References to
rev-parse
in homebrew-core: https://github.com/Homebrew/homebrew-core/search?q=rev-parse