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

Re: Retrieving last tag of a working tree

From
Thomas Rast <trast@student.ethz.ch>
Date
Dec 21, 2008, 15:28 UTC
Message-ID
<200812211628.59120.trast@student.ethz.ch>
In-Reply-To
<21071491.post@talk.nabble.com>
the_jack wrote:
Show 6 quoted lines
> Precompiler assigns this string to a variable. At this moment, version.h is
> filled by python script that calls "git-describe --tag HEAD" and parses the
> output. This works, but it's not quite reliable. There has to be a better
> way for getting the last tag of current working tree. If I checkout an
> earlier tagged version (0.70), I would need to automatically get 0.70 inside
> version.h

'git describe' is indeed the tool for this. You have not said in what way it fails, so here's an educated guess:

Up until 7e425c4 (describe: Make --tags and --all match lightweight tags more often, 2008-10-13) which will only be in 1.6.1, using --tags does not match a lightweight tag if there is also an annotated tag available.

-Thomas
-- 
Thomas Rast
trast@{inf,student}.ethz.ch
Previous: Sitaram Chamarty
Message 3 of 3 in “Retrieving last tag of a working tree”
  1. the_jackDec 18, 2008
  2. Sitaram ChamartyDec 21, 2008
  3. Thomas RastDec 21, 2008

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.