git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / Atom feed
* Q: git describe --always --tags .. gives "warning: tag 'tag1' is really 'tag2' here"
@ 2019-05-29  7:45 Ulrich Windl
  2019-05-29 18:01 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Ulrich Windl @ 2019-05-29  7:45 UTC (permalink / raw)
  To: git

Hi!

I have a project that changed its name some time ago (from "isredir" to "iredir"), so I added another tag for the same commit ID (What's the command to show the commit IDs for tags, BTW?: "git tag -v" does not.

As part of the build process, I run (for example) "git describe --always --tags af467c7".
So I got the response:
warning: tag 'isredir-0.3.0' is really 'iredir-0.3.0' here
isredir-0.3.0-3-gaf467c7

I'm unsure what the message is actually saying: The hash cannot be resolved in a unique way?

I just see two tags remaining in refs:
> ls .git/refs/tags/
iredir-0.3.0  iredir-0.3.1

Regards,
Ulrich



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Q: git describe --always --tags .. gives "warning: tag 'tag1' is really 'tag2' here"
  2019-05-29  7:45 Q: git describe --always --tags .. gives "warning: tag 'tag1' is really 'tag2' here" Ulrich Windl
@ 2019-05-29 18:01 ` Junio C Hamano
  2019-06-03  6:06   ` Antw: " Ulrich Windl
  0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2019-05-29 18:01 UTC (permalink / raw)
  To: Ulrich Windl; +Cc: git

"Ulrich Windl" <Ulrich.Windl@rz.uni-regensburg.de> writes:

> So I got the response:
> warning: tag 'isredir-0.3.0' is really 'iredir-0.3.0' here
> isredir-0.3.0-3-gaf467c7

I suspect that "git cat-file tag isredir-0.3.0" would begin like

	$ git cat-file tag iredir-0.3.0
	object .....
	type commit
	tag isredir-0.3.0
	tagger ...

Notice that "tag" line records the true name of that tag, which does
not match where you stored that tag in refs/tags/ hierarchy?

While trying to describe af467c7 by following its ancestry and
finding the ancestor three generations ago, the command found
refs/tags/iredir-0.3.0 and then noticed that discrepancy, which is
what the warning is about.

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).





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Antw: Re: Q: git describe --always --tags .. gives "warning: tag 'tag1' is really 'tag2' here"
  2019-05-29 18:01 ` Junio C Hamano
@ 2019-06-03  6:06   ` Ulrich Windl
  2019-06-03 10:55     ` Jeff King
  0 siblings, 1 reply; 4+ messages in thread
From: Ulrich Windl @ 2019-06-03  6:06 UTC (permalink / raw)
  To: gitster, git

>>> Junio C Hamano <gitster@pobox.com> schrieb am 29.05.2019 um 20:01 in
Nachricht
<xmqqd0k1ywal.fsf@gitster-ct.c.googlers.com>:
> "Ulrich Windl" <Ulrich.Windl@rz.uni‑regensburg.de> writes:
> 
>> So I got the response:
>> warning: tag 'isredir‑0.3.0' is really 'iredir‑0.3.0' here
>> isredir‑0.3.0‑3‑gaf467c7
> 
> I suspect that "git cat‑file tag isredir‑0.3.0" would begin like
> 
> 	$ git cat‑file tag iredir‑0.3.0
> 	object .....
> 	type commit
> 	tag isredir‑0.3.0
> 	tagger ...
> 
> Notice that "tag" line records the true name of that tag, which does
> not match where you stored that tag in refs/tags/ hierarchy?

Hi!

Sorry for the delay (long weekend): Yes it is as you guessed. The tag is a
signed one, BTW.

> 
> While trying to describe af467c7 by following its ancestry and
> finding the ancestor three generations ago, the command found
> refs/tags/iredir‑0.3.0 and then noticed that discrepancy, which is
> what the warning is about.
> 
> 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).

Regards,
Ulrich


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Antw: Re: Q: git describe --always --tags .. gives "warning: tag 'tag1' is really 'tag2' here"
  2019-06-03  6:06   ` Antw: " Ulrich Windl
@ 2019-06-03 10:55     ` Jeff King
  0 siblings, 0 replies; 4+ messages in thread
From: Jeff King @ 2019-06-03 10:55 UTC (permalink / raw)
  To: Ulrich Windl; +Cc: gitster, git

On Mon, Jun 03, 2019 at 08:06:54AM +0200, Ulrich Windl wrote:

> > 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-06-03 10:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-29  7:45 Q: git describe --always --tags .. gives "warning: tag 'tag1' is really 'tag2' here" Ulrich Windl
2019-05-29 18:01 ` Junio C Hamano
2019-06-03  6:06   ` Antw: " Ulrich Windl
2019-06-03 10:55     ` Jeff King

git@vger.kernel.org list mirror (unofficial, one of many)

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 git git/ https://public-inbox.org/git \
		git@vger.kernel.org
	public-inbox-index git

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.io/gmane.comp.version-control.git
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for the project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git