-
Notifications
You must be signed in to change notification settings - Fork 332
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
Add a way to get commitId for master branch #574
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: srinivashegde86 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/cc @yanweiguo |
/lgtm |
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.
/lgtm
/assign @mattmoor
/hold
if you want to change the comment.
) | ||
|
||
var ( | ||
commitIDRE = regexp.MustCompile(`^[a-f0-9]{40}$`) | ||
) | ||
|
||
// Get tries to fetch the first 7 digitals of GitHub commit ID from HEAD file in | ||
// get tries to fetch the first 7 digitals of GitHub commit ID from given file in |
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.
// get tries to fetch the first 7 digitals of GitHub commit ID from given file in | |
// get tries to fetch the first 7 hex digits of GitHub commit ID from given file in |
Not strongly set on this, but it reads better for me. Same below.
With ko-build/ko#73 we can |
#576 adds this change to read from the links in .git/HEAD. CLosing this PR as we can use that. |
Currently, we only look at
.git/HEAD
to get commitId. But, this only provides us with the commitId when the head is in detached state. If we are working on some branch, this will give us a ref to the branch head, which we should then read to get the commitId for that branch.This PR adds a way to get the commitId from the master branch.