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

Is it possible get the tag name of working copy in Git?

From
CCchen chang <chenchangs@gmail.com>
Date
Mar 13, 2015, 07:08 UTC
Message-ID
<CAFL7HFUNMrTfLx+kj6rBiNeuLhbkPF_t32kOYYSxBP9F=eKSxQ@mail.gmail.com>

I want to use make file auto generate the revision number of working copy from the tag name in git. So as questioned in subject, I have tried to use 'git describe', it works well in most case, and the output is good match my requirement. Problem is: when there are multiple tags on same one commit, if check out one of these tag, the 'git describe' only be able to return the most new created tag name in that commit, instead of the real checked out tag.

Seems 'git-describe' capture the most recent tag name by create sequence.

I expect add an argument to 'git-describe' to make it get the most recent tag name according to checkout status when multiple tags on one commit.

Is there any suggestion? Thanks!

------------------------------ Chen Chang

Next: Torsten Bögershausen
Message 1 of 3 in “Is it possible get the tag name of working copy in Git?”
  1. chen changMar 13, 2015
  2. Torsten BögershausenMar 13, 2015
  3. Stefan BellerMar 13, 2015

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.