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

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

From
Roland Hieber <rhi@pengutronix.de>
Date
Feb 5, 2020, 14:13 UTC
Message-ID
<20200205141332.lov2f2fvinehcd3a@pengutronix.de>
Hi,

I'm working with the GCC Git repo [0] (which was apparently recently converted from SVN [1]), and I'm trying to find out the most recent tag. So on the master branch I do:

    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:

    gcc (master) $ git show gcc_9_2_0_release
    fatal: ambiguous argument 'gcc_9_2_0_release': unknown revision or path not in the working tree.
    Use '--' to separate paths from revisions, like this:
    'git <command> [<revision>...] -- [<file>...]'
That name is in the tag itself:
    gcc (master) $ git show releases/gcc-9.2.0 | head -n3
    tag gcc_9_2_0_release
    Tagger: Jakub Jelinek <jakub@gcc.gnu.org>
    Date:   2019-08-12 09:38:59

So my question is: is it the intended behaviour of 'git-describe --tags' that it outputs tag names that cannot be used as a ref? If so, what is a good other way to find out the most recent tag?

[0]: git://gcc.gnu.org/git/gcc.git,
     https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git
[1]: https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;a=tag;h=f5b196de86fde51578354ff5f98be6d9c397c8fe
Thanks,
-- 
Roland Hieber, Pengutronix e.K.          | r.hieber@pengutronix.de     |
Steuerwalder Str. 21                     | https://www.pengutronix.de/ |
31137 Hildesheim, Germany                | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686         | Fax:   +49-5121-206917-5555 |
Next: Matheus Tavares Bernardino
Message 1 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.