-
Notifications
You must be signed in to change notification settings - Fork 76
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
Plugin output vs git describe
: different commit hash length
#703
Comments
Its worth pointing out that the commit hash you are seeing is not the full hash (which is typically 40 characters long) but an abbreviation of the first few characters. The length of this abbreviated hash returned by If you want to ensure that |
I'm aware of that, but note Git returns 7, or the minimum needed to ensure uniqueness, which is why it returns 8 in this case. Shouldn't the plugin apply the same logic? |
Sorry you're right, I did not consider that git smartly returns you more characters if the default abbreviation is not unique. I guess one downside would be that we loose some strictness regarding how these versions are structured. We would also need to ensure that downstream consumers of those versions can handle variable length suffixes (i.e. sls-version-java and sls-version-js). I would hope so though! |
Yes, and in addition, the problem is even worse when the CI system (Google Cloud Build in the case where I encountered this) does not checkout tags, therefore the output consists only of the non-unique abbreviated hash, with no "relative to tag" component. |
What happened?
I have a repository in which
git describe --tags --always --first-parent
returnsv2023031601-38-g3b46af6d
. However, the plugin returnsv2023031601-38-g3b46af6
-- note the commit hash is one letter shorter.What did you want to happen?
The two outputs should be the same.
The text was updated successfully, but these errors were encountered: