VCS Labeling on git creates two tags, one with "^{}" suffix

Answered

I have set up VCS Labeling on our deploy script, with the template:

staging-%system.build.number%-%teamcity.build.triggeredBy.username%-%teamcity.build.branch%

This is working, but for some reason it's creating two tags each time, one of which has a strange suffix:

MacBook-Pro:web grant$ git ls-remote --tags origin
de1dcb5963b12239e23fbae3c3a77c350b1f24b8 refs/tags/staging-21-gcox-tag-creator-alr
a5c1e11c9474911b16283f8c4834a6bcf293aa8d refs/tags/staging-21-gcox-tag-creator-alr^{}
08155f27a798521bef1bf8cd971a31cb21f0cf88 refs/tags/staging-22-gcox-grow-1643-tests-sg
b6e11f5c357f6c1dd263ab1160fcad45983096c8 refs/tags/staging-22-gcox-grow-1643-tests-sg^{}
6d1016823bffd0c08ba5893c1a9cf57ac0a677ca refs/tags/staging-23-gcox-grow-1680-whatsapp-sg
4f63f8f3e4bb9cbc9b66c139ee0a3cc87bee16b2 refs/tags/staging-23-gcox-grow-1680-whatsapp-sg^{}

For each of these, the two commit hashes are both valid, one is an alias to the other.  But sometimes the tag with the "correct name" is the correct commit hash, and the "weird suffix" is some kind of alias to that.  But other times it's vice versa.

MacBook-Pro:web grant$ git log -n1 refs/tags/staging-21-gcox-tag-creator-alr
commit a5c1e11c9474911b16283f8c4834a6bcf293aa8d
MacBook-Pro:web grant$ git log -n1 refs/tags/staging-21-gcox-tag-creator-alr^{}
commit a5c1e11c9474911b16283f8c4834a6bcf293aa8d
MacBook-Pro:web grant$ git log -n1 refs/tags/staging-22-gcox-grow-1643-tests-sg
commit b6e11f5c357f6c1dd263ab1160fcad45983096c8
MacBook-Pro:web grant$ git log -n1 refs/tags/staging-22-gcox-grow-1643-tests-sg^{}
commit b6e11f5c357f6c1dd263ab1160fcad45983096c8

In some way these seem harmless enough, but just clutter up the tag list unnecessarily.  Any idea what's going on here?

3 comments

Hello Grant,

Thank you for the details report. Actually TeamCity creates annotated tags. The first one is a tag, the second one is a commit this tag points to.

0

Aha, interesting.  In that case, can I provide a useful message in the annotation (ie from a build variable)?  Or if I can't, can I just use lightweight tags?

0

Currently it's not supported. Please feel free to create a feature request in our tracker: https://youtrack.jetbrains.com/issues/TW.

As workaround you use agent-side checkout and tag the commit in the last build step.

0

Please sign in to leave a comment.