git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git-describe --tags warning: 'X' is really 'Y' here

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 14, 2020, 16:57 UTC
Message-ID
<xmqqd0ahp0na.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20200214065352.GG605125@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 27 quoted lines
>> >     gcc (master) $ git describe --tags --abbrev=0
>> >     warning: tag 'gcc_9_2_0_release' is really 'releases/gcc-9.2.0' here
>> >     gcc_9_2_0_release
>> >
>> > It took me a while to find out what the warning means, because
>> > 'gcc_9_2_0_release' is not in $(git tag -l), and it cannot be used as a
>> > ref either:
>> [...]
>> It seems that the commit which added the output message you got is
>> 212945d ("Teach git-describe to verify annotated tag names before
>> output", 2008-02-28) [1]. As the commit message states, the warning is
>> emitted when a tag is locally stored under a different name from the
>> one it was originally created (being the former the one you will want
>> to use at `git show`).
>
> Yeah, I think that is what's going on with that warning, but there's a
> weird thing about the actual stdout output. We see a tag object whose
> name doesn't match the ref. What's the "real" name of that tag? Is it
> the name in the object, and the ref is wrong? Or is the ref correct, and
> the object is wrong?
>
> You could get pretty philosophical there, I think, but it seems slightly
> annoying that we print the name from the object to stdout, when one
> cannot then use that name to access the tag in any way.
>
> I.e., I think it might be reasonable to issue that warning but then
> print "releases/gcc-9.2.0" instead.

I agree. What the tag creator, whom you treat as more authoritative than yourself, called "gcc_9_2_0_release", is stored at a wrong place by you and you have to call it "releases/gcc-9.2.0". So the right way (at least philosophically) to phrase the warning message should reflect that a bit better, perhaps

  warning: tag 'releases/gcc-9.2.0' is externally known as 'gcc_9_2_0_release'
  releases/gcc-9.2.0

to hint that 'releases/gcc-9.2.0' is merely how you name it and the real name of the tag itself is gcc_9_2_0_release, although in practice everybody would be calling the tag with the same wrong name, as that is how cloning and fetching of tags work ;-).

Previous: Jeff KingNext: Matheus Tavares
Message 4 of 23 in “git-describe --tags warning: 'X' is really 'Y' here”
  1. Roland HieberFeb 5, 2020
  2. Matheus Tavares BernardinoFeb 5, 2020
  3. Jeff KingFeb 14, 2020
  4. Junio C HamanoFeb 14, 2020
  5. describe: output tag's ref instead of embedded nameMatheus Tavares, Feb 15, 2020
  6. Jeff KingFeb 16, 2020
  7. Junio C HamanoFeb 18, 2020
  8. Jeff KingFeb 18, 2020
  9. Junio C HamanoFeb 18, 2020
  10. Junio C HamanoFeb 18, 2020
  11. Jeff KingFeb 19, 2020
  12. Junio C HamanoFeb 19, 2020
  13. Jeff KingFeb 19, 2020
  14. Junio C HamanoFeb 19, 2020
  15. Jeff KingFeb 20, 2020
  16. Junio C HamanoFeb 20, 2020
  17. Matheus Tavares BernardinoFeb 20, 2020
  18. Junio C HamanoFeb 20, 2020
  19. Matheus TavaresFeb 21, 2020
  20. Junio C HamanoFeb 21, 2020
  21. Jeff KingFeb 21, 2020
  22. Jeff KingFeb 21, 2020
  23. Roland HieberFeb 19, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.