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

Re: Antw: Re: Q: git describe --always --tags .. gives "warning: tag 'tag1' is really 'tag2' here"

From
Jeff King <peff@peff.net>
Date
Jun 3, 2019, 10:55 UTC
Message-ID
<20190603105536.GA12649@sigill.intra.peff.net>
In-Reply-To
<5CF4B8FE020000A100031962@gwsmtp.uni-regensburg.de>
On Mon, Jun 03, 2019 at 08:06:54AM +0200, Ulrich Windl wrote:
Show 11 quoted lines
> > Imagine you have only v1.0.0 (which is with known issues) but
> > somebody did "cd .git/refs/tags && mv v1.0.0 v1.1.0" in an attempt
> > to fool you.  The fact that your 'master' is a bit ahead of the
> > commit that was tagged with the tag object (which is v1.0.0 but
> > pretending to be v1.1.0) can be seen with "describe", but the
> > command is careful enough to use the real version number
> > (i.e. v1.0.0) and not the refname (i.e. v1.1.0).
> 
> Still I'm missing a verbose version of "git tag" that shows the commit IDs
> along with the tag names. Unfortunately "-v" is not "--verbose" but "--verify"
> (as opposed to "git remote" for example).
You can use for-each-ref format strings with "git tag" these days. E.g.:
  git tag --list --format='%(refname:short) %(tag) %(*objecttype) %(*objectname)'

will show each tag with its refname and tag-object name (which generally match, but would not in the case discussed here), and then the type and oid of the pointed-to thing (the "*" is a "dereference").

-Peff
Previous: Ulrich Windl
Message 4 of 4 in “Q: git describe --always --tags .. gives "warning: tag 'tag1' is really 'tag2' here"”
  1. Ulrich WindlMay 29, 2019
  2. Junio C HamanoMay 29, 2019
  3. Antw: Re: Q: git describe --always --tags .. gives "warning: tag 'tag1' is really 'tag2' here"Ulrich Windl, Jun 3, 2019
  4. Jeff KingJun 3, 2019

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.