Closed plumlee closed 7 years ago
Thank you for your suggestion. However, I thought about this a bit but can't defend introducing such an option. That's because:
(1) The module is basically a fancy wrapper around git describe
, and prepending a g
to the hash is standard and documented behavior of this git command.
(2) It's easy to do this with postprocessing in the code that uses this module. For example by taking a substring of hash
that skips 1 character and optionally combining that with other properties. If you're interested in the semver string, just call format()
on the SemVer instance and add a customized build identifier including the modified hash.
If there is a flaw in my reasoning or if I overlooked something, feel free to make a counterargument.
Appreciate the response - I understand both of your arguments.
The commit hash part of the output for git-describe is always prefixed with a 'g', representing git as the VCS being used. It would make the output more useful in a copy/paste situation to strip that character off (or have an option to allow that as the output). I could see this also being more useful in machine parsing the output, although I'm sure most scripts already have a step to do this.
If you're open to this, I'll make a PR.