mirror of
https://github.com/semver/semver.git
synced 2026-03-24 03:51:58 -05:00
Adding git commit hash / source version id to the version number #435
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @matepek on GitHub (Sep 18, 2020).
Hello,
I'm just wondering what are the cons and pros of adding a git commit hash (or some kind of version control identifier) as part of the version. For first it seems useful to me.
@ghost commented on GitHub (Oct 25, 2020):
If you could concatenate the hash the be the same size as
<build>, then maybe? Something like this:@matepek commented on GitHub (Oct 25, 2020):
Why is the "same size" a requirement?
@ghost commented on GitHub (Oct 25, 2020):
Thinking back, I guess it doesn't need to be. There are no size requirements AFAICT, aside from this recommendation:
The original
<version core> "-" <pre-release> "+" <build> "#" <source-version-id>is too long in my opinion.@matepek commented on GitHub (Oct 25, 2020):
Technically should be redundant. But seems so convenient having it.
Build number can be essential too. The "good judgment" is a guide for the users (like me) but the standard could allow it. ^^
@ghost commented on GitHub (Oct 25, 2020):
The build metadata already allows for commit hashes to be used (along with the build number if you wish) as long as the hash is alphanumeric.
@Nixinova commented on GitHub (Jan 12, 2021):
Just include the git hash as part of the metadata string. Use a double hyphen or something instead of a hash sign and that grammar works.
@jwdonahue commented on GitHub (Sep 7, 2021):
The meta tag is where we traditionally put content hashes. The use of the
#character could cause problems in some systems, where the version string is encoded in a URL, but we already have to work around the+character on that score. Why add another one? If we were to add tag types to SemVer, a VersionMeta tag would top my priority list. Then you could independently define the format your prerelease and buildmeta tags as well.