There was inconsistency in how annotated tags were handled by various git backends (git, gitcmd) and various methods (ResolveRevision, ResolveTag, Tags). In some cases, annotated tags were dereferenced, and in other cases, they were not. This is issue #24.
This PR fixes the inconsistency by opting to always dereference annotated tags to the underlying commit ID.
It consists of two logical commits (please don't squash them, otherwise information will be lost):
First commit adds tests that cover the inconsistent annotated tag behavior, without changing the implementation. The tests demonstrate the inconsistent behavior, and are passing.
Second commit changes git and gitcmd behavior to always dereference annotated tags, and updates tests to have consistent output. The tests are passing.
The decision to always dereference annotated tags is based the following rationale. This behavior is more consistent with the high level nature of the vcs API, and it's easier for users to consume. If detailed tag information is needed, support for that can be added as an optional enhancement.
Fixes #24.
/cc @keegancsmith @slimsag Happy to answer any questions about this, or elaborate on any part.
There was inconsistency in how annotated tags were handled by various git backends (git, gitcmd) and various methods (
ResolveRevision
,ResolveTag
,Tags
). In some cases, annotated tags were dereferenced, and in other cases, they were not. This is issue #24.This PR fixes the inconsistency by opting to always dereference annotated tags to the underlying commit ID.
It consists of two logical commits (please don't squash them, otherwise information will be lost):
First commit adds tests that cover the inconsistent annotated tag behavior, without changing the implementation. The tests demonstrate the inconsistent behavior, and are passing.
Second commit changes
git
andgitcmd
behavior to always dereference annotated tags, and updates tests to have consistent output. The tests are passing.The decision to always dereference annotated tags is based the following rationale. This behavior is more consistent with the high level nature of the
vcs
API, and it's easier for users to consume. If detailed tag information is needed, support for that can be added as an optional enhancement.Fixes #24.
/cc @keegancsmith @slimsag Happy to answer any questions about this, or elaborate on any part.