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

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

From
Torsten Bögershausen <tboegi@web.de>
Date
Mar 13, 2015, 09:36 UTC
Message-ID
<5502AF86.9050803@web.de>
In-Reply-To
<CAFL7HFUNMrTfLx+kj6rBiNeuLhbkPF_t32kOYYSxBP9F=eKSxQ@mail.gmail.com>
On 03/13/2015 08:08 AM, chen chang wrote:
> I want to use make file auto generate the revision number of working
> copy from the tag name in git.

You should have the tag name, as it is set up before running make, and probably feed into both "git checkout tagXXYYXX" and the Makefile.

If you want the "version number", what is this ? Git has a sha value, you can git it like this:

git rev-parse HEAD  | cut -b 1-9
HTH
Previous: chen changNext: Stefan Beller
Message 2 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.