{"thread":{"id":"51194","subject":"Q: git describe --always --tags .. gives \"warning: tag 'tag1' is really 'tag2' here\"","startedAt":"2019-05-29T07:46:03Z","lastAt":"2019-06-03T10:55:54Z","messageCount":4,"participants":["Ulrich Windl","Junio C Hamano","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"376382","messageId":"5CEE38B4020000A1000317C6@gwsmtp.uni-regensburg.de","threadId":"51194","inReplyTo":null,"subject":"Q: git describe --always --tags .. gives \"warning: tag 'tag1' is really 'tag2' here\"","fromName":"Ulrich Windl","fromEmail":"ulrich.windl@rz.uni-regensburg.de","sentAt":"2019-05-29T07:45:56Z","receivedAt":"2019-05-29T07:46:03Z","isPatch":false,"sender":{"key":"ulrich.windl@rz.uni-regensburg.de","avatar":null},"body":"Hi!\n\nI have a project that changed its name some time ago (from \"isredir\" to \"iredir\"), so I added another tag for the same commit ID (What's the command to show the commit IDs for tags, BTW?: \"git tag -v\" does not.\n\nAs part of the build process, I run (for example) \"git describe --always --tags af467c7\".\nSo I got the response:\nwarning: tag 'isredir-0.3.0' is really 'iredir-0.3.0' here\nisredir-0.3.0-3-gaf467c7\n\nI'm unsure what the message is actually saying: The hash cannot be resolved in a unique way?\n\nI just see two tags remaining in refs:\n> ls .git/refs/tags/\niredir-0.3.0  iredir-0.3.1\n\nRegards,\nUlrich\n\n\n"},{"id":"376409","messageId":"xmqqd0k1ywal.fsf@gitster-ct.c.googlers.com","threadId":"51194","inReplyTo":"5CEE38B4020000A1000317C6@gwsmtp.uni-regensburg.de","subject":"Re: Q: git describe --always --tags .. gives \"warning: tag 'tag1' is really 'tag2' here\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-05-29T18:01:38Z","receivedAt":"2019-05-29T18:01:43Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Ulrich Windl\" <Ulrich.Windl@rz.uni-regensburg.de> writes:\n\n> So I got the response:\n> warning: tag 'isredir-0.3.0' is really 'iredir-0.3.0' here\n> isredir-0.3.0-3-gaf467c7\n\nI suspect that \"git cat-file tag isredir-0.3.0\" would begin like\n\n\t$ git cat-file tag iredir-0.3.0\n\tobject .....\n\ttype commit\n\ttag isredir-0.3.0\n\ttagger ...\n\nNotice that \"tag\" line records the true name of that tag, which does\nnot match where you stored that tag in refs/tags/ hierarchy?\n\nWhile trying to describe af467c7 by following its ancestry and\nfinding the ancestor three generations ago, the command found\nrefs/tags/iredir-0.3.0 and then noticed that discrepancy, which is\nwhat the warning is about.\n\nImagine you have only v1.0.0 (which is with known issues) but\nsomebody did \"cd .git/refs/tags && mv v1.0.0 v1.1.0\" in an attempt\nto fool you.  The fact that your 'master' is a bit ahead of the\ncommit that was tagged with the tag object (which is v1.0.0 but\npretending to be v1.1.0) can be seen with \"describe\", but the\ncommand is careful enough to use the real version number\n(i.e. v1.0.0) and not the refname (i.e. v1.1.0).\n\n\n\n\n"},{"id":"376556","messageId":"5CF4B8FE020000A100031962@gwsmtp.uni-regensburg.de","threadId":"51194","inReplyTo":"xmqqd0k1ywal.fsf@gitster-ct.c.googlers.com","subject":"Antw: Re: Q: git describe --always --tags .. gives \"warning: tag 'tag1' is really 'tag2' here\"","fromName":"Ulrich Windl","fromEmail":"ulrich.windl@rz.uni-regensburg.de","sentAt":"2019-06-03T06:06:54Z","receivedAt":"2019-06-03T06:07:00Z","isPatch":false,"sender":{"key":"ulrich.windl@rz.uni-regensburg.de","avatar":null},"body":">>> Junio C Hamano <gitster@pobox.com> schrieb am 29.05.2019 um 20:01 in\nNachricht\n<xmqqd0k1ywal.fsf@gitster-ct.c.googlers.com>:\n> \"Ulrich Windl\" <Ulrich.Windl@rz.uni‑regensburg.de> writes:\n> \n>> So I got the response:\n>> warning: tag 'isredir‑0.3.0' is really 'iredir‑0.3.0' here\n>> isredir‑0.3.0‑3‑gaf467c7\n> \n> I suspect that \"git cat‑file tag isredir‑0.3.0\" would begin like\n> \n> \t$ git cat‑file tag iredir‑0.3.0\n> \tobject .....\n> \ttype commit\n> \ttag isredir‑0.3.0\n> \ttagger ...\n> \n> Notice that \"tag\" line records the true name of that tag, which does\n> not match where you stored that tag in refs/tags/ hierarchy?\n\nHi!\n\nSorry for the delay (long weekend): Yes it is as you guessed. The tag is a\nsigned one, BTW.\n\n> \n> While trying to describe af467c7 by following its ancestry and\n> finding the ancestor three generations ago, the command found\n> refs/tags/iredir‑0.3.0 and then noticed that discrepancy, which is\n> what the warning is about.\n> \n> Imagine you have only v1.0.0 (which is with known issues) but\n> somebody did \"cd .git/refs/tags && mv v1.0.0 v1.1.0\" in an attempt\n> to fool you.  The fact that your 'master' is a bit ahead of the\n> commit that was tagged with the tag object (which is v1.0.0 but\n> pretending to be v1.1.0) can be seen with \"describe\", but the\n> command is careful enough to use the real version number\n> (i.e. v1.0.0) and not the refname (i.e. v1.1.0).\n\nStill I'm missing a verbose version of \"git tag\" that shows the commit IDs\nalong with the tag names. Unfortunately \"-v\" is not \"--verbose\" but \"--verify\"\n(as opposed to \"git remote\" for example).\n\nRegards,\nUlrich\n\n"},{"id":"376562","messageId":"20190603105536.GA12649@sigill.intra.peff.net","threadId":"51194","inReplyTo":"5CF4B8FE020000A100031962@gwsmtp.uni-regensburg.de","subject":"Re: Antw: Re: Q: git describe --always --tags .. gives \"warning: tag 'tag1' is really 'tag2' here\"","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2019-06-03T10:55:36Z","receivedAt":"2019-06-03T10:55:54Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Jun 03, 2019 at 08:06:54AM +0200, Ulrich Windl wrote:\n\n> > Imagine you have only v1.0.0 (which is with known issues) but\n> > somebody did \"cd .git/refs/tags && mv v1.0.0 v1.1.0\" in an attempt\n> > to fool you.  The fact that your 'master' is a bit ahead of the\n> > commit that was tagged with the tag object (which is v1.0.0 but\n> > pretending to be v1.1.0) can be seen with \"describe\", but the\n> > command is careful enough to use the real version number\n> > (i.e. v1.0.0) and not the refname (i.e. v1.1.0).\n> \n> Still I'm missing a verbose version of \"git tag\" that shows the commit IDs\n> along with the tag names. Unfortunately \"-v\" is not \"--verbose\" but \"--verify\"\n> (as opposed to \"git remote\" for example).\n\nYou can use for-each-ref format strings with \"git tag\" these days. E.g.:\n\n  git tag --list --format='%(refname:short) %(tag) %(*objecttype) %(*objectname)'\n\nwill show each tag with its refname and tag-object name (which generally\nmatch, but would not in the case discussed here), and then the type and\noid of the pointed-to thing (the \"*\" is a \"dereference\").\n\n-Peff\n"}]}