GitVersion icon indicating copy to clipboard operation
GitVersion copied to clipboard

Feature suggestion: Pre-release tag that indicates commit (short SHA)

Open urig opened this issue 10 years ago • 8 comments

As a GitVersion user, I'd like to be able to generate a unique version for a given commit that indicates the identity of this commit.

For example, when running on a branch where the latest commit is e81220c95e5dd407ffc340baf2fbec7e21f76be9 I'd like to get a FullSemVer that looks like '1.3.8-commit.e81220c+2`.

As the person suggesting this feature I would suggest a new setting for the tag configuration setting: "commit". When "commit" is specified, the UpdatePreReleaseTag() method will fetch the current commit SHA, truncate it and use it for the PreReleaseTag.

urig avatar Jun 01 '16 09:06 urig

I volunteer to implement ;)

urig avatar Jun 01 '16 09:06 urig

This is a feature I would also like to see. I'd suggest using tag: {useCommitHash} which is similar to {useBranchName}

simonejsing avatar Jun 29 '16 22:06 simonejsing

tag: useCommitHash and {CommitHash} sound like useful additions! A PR with good test coverage of this would have a high probability of being merged. :smiley: :+1:

asbjornu avatar Jun 30 '16 08:06 asbjornu

Hey @urig, have you managed to implement this? anyone else maybe?

superware avatar Aug 29 '18 09:08 superware

#1452 seems related to this

santiagovm avatar Oct 10 '18 23:10 santiagovm

@santiagovm #1405 seems a better solution for this reason

pmiossec avatar Oct 11 '18 07:10 pmiossec

As the OP, I concur. I think we can close this Issue in favor of https://github.com/GitTools/GitVersion/pull/1405 .

urig avatar Oct 11 '18 09:10 urig

don't close the issue until it's merged... otherwise other people will think it's solved...

pmiossec avatar Oct 11 '18 09:10 pmiossec