Use just GitVersion for the -version output #1251
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It turns out that that's simply the most useful information about the version that was built.
For a git tree, it includes information about the closest release, number of commits since the release, enough of the SHA1 to find the exact commit and whether the tree was clean or dirty at build time.
For a build from tarball, it will include information of which release was built and, when using a tarball from a not released commit (e.g. downloading "master.tar.gz" from GitHub, not recommended!) it will include the -dev prefix to indicate that was not an official release. (That's as good as we can get with it.)
If additional information is required, it can be found with -version=raw.
I tested most use cases, I didn't test tarball with official version since that requires additional commits, at the time we release v0.3 I'll have a chance to experiment with that in my fork before we push the tag upstream.
Cheers,
Filipe