git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Why does git-describe warn about something that you can't control?
@ 2008-12-26 11:50 demerphq
  2008-12-26 13:44 ` René Scharfe
  0 siblings, 1 reply; 2+ messages in thread
From: demerphq @ 2008-12-26 11:50 UTC (permalink / raw)
  To: git

On the perl.git repo if I use git-describe --all on some commits I get
warnings like this:

$ git describe --all 3417e4f8422bcf13f799ce1acef44b27ccbef3d8
warning: tag 'perl-5.005_04' is really 'tags/perl-5.005_04' here
perl-5.005_04

Except there doesnt seem to be any explanation for why the warning is
being produced (it almost, but not quite looks random for the commits
im looking at), how to silence it, or how to force git-describe to for
instance use "tags/perl-5.8.0" instead so the warning is not
generated.

I think this behaviour is confusing, either the warning should go
away, or it should be improved and complemented by a switch to force
git-describe to use the qualified tagname instead, or at the very
least a switch to silence the warning (which is really annoying when
you are doing git-describe on hundreds of commits in a go).

Details for the perl repo are in my signature.

Yves
-- 
git clone git://perl5.git.perl.org/perl

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

* Re: Why does git-describe warn about something that you can't control?
  2008-12-26 11:50 Why does git-describe warn about something that you can't control? demerphq
@ 2008-12-26 13:44 ` René Scharfe
  0 siblings, 0 replies; 2+ messages in thread
From: René Scharfe @ 2008-12-26 13:44 UTC (permalink / raw)
  To: demerphq; +Cc: git, Shawn O. Pearce

demerphq schrieb:
> On the perl.git repo if I use git-describe --all on some commits I get
> warnings like this:
> 
> $ git describe --all 3417e4f8422bcf13f799ce1acef44b27ccbef3d8
> warning: tag 'perl-5.005_04' is really 'tags/perl-5.005_04' here
> perl-5.005_04
> 
> Except there doesnt seem to be any explanation for why the warning is
> being produced (it almost, but not quite looks random for the commits
> im looking at), how to silence it, or how to force git-describe to for
> instance use "tags/perl-5.8.0" instead so the warning is not
> generated.
> 
> I think this behaviour is confusing, either the warning should go
> away, or it should be improved and complemented by a switch to force
> git-describe to use the qualified tagname instead, or at the very
> least a switch to silence the warning (which is really annoying when
> you are doing git-describe on hundreds of commits in a go).

The warning was introduced by 212945d4 ("Teach git-describe to verify
annotated tag names before output") by Shawn (cc:'d).

The following patch should fix your issue by making describe ignore the
"tags/" path prefix of, well, tags, which is only present if you call
it with the option --all.

diff --git a/builtin-describe.c b/builtin-describe.c
index d2cfb1b..3a007ed 100644
--- a/builtin-describe.c
+++ b/builtin-describe.c
@@ -158,7 +158,7 @@ static void display_name(struct commit_name *n)
 		n->tag = lookup_tag(n->sha1);
 		if (!n->tag || parse_tag(n->tag) || !n->tag->tag)
 			die("annotated tag %s not available", n->path);
-		if (strcmp(n->tag->tag, n->path))
+		if (strcmp(n->tag->tag, all ? n->path + 5 : n->path))
 			warning("tag '%s' is really '%s' here", n->tag->tag, n->path);
 	}
 

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

end of thread, other threads:[~2008-12-26 13:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-26 11:50 Why does git-describe warn about something that you can't control? demerphq
2008-12-26 13:44 ` René Scharfe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).