{"thread":{"id":"16870","subject":"Why does git-describe warn about something that you can't control?","startedAt":"2008-12-26T11:50:41Z","lastAt":"2008-12-26T13:44:44Z","messageCount":2,"participants":["demerphq","René Scharfe"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"98724","messageId":"9b18b3110812260350q6870700du982ec3a7a91950e2@mail.gmail.com","threadId":"16870","inReplyTo":null,"subject":"Why does git-describe warn about something that you can't control?","fromName":"demerphq","fromEmail":"demerphq@gmail.com","sentAt":"2008-12-26T11:50:41Z","receivedAt":"2008-12-26T11:50:41Z","isPatch":false,"sender":{"key":"demerphq@gmail.com","avatar":null},"body":"On the perl.git repo if I use git-describe --all on some commits I get\nwarnings like this:\n\n$ git describe --all 3417e4f8422bcf13f799ce1acef44b27ccbef3d8\nwarning: tag 'perl-5.005_04' is really 'tags/perl-5.005_04' here\nperl-5.005_04\n\nExcept there doesnt seem to be any explanation for why the warning is\nbeing produced (it almost, but not quite looks random for the commits\nim looking at), how to silence it, or how to force git-describe to for\ninstance use \"tags/perl-5.8.0\" instead so the warning is not\ngenerated.\n\nI think this behaviour is confusing, either the warning should go\naway, or it should be improved and complemented by a switch to force\ngit-describe to use the qualified tagname instead, or at the very\nleast a switch to silence the warning (which is really annoying when\nyou are doing git-describe on hundreds of commits in a go).\n\nDetails for the perl repo are in my signature.\n\nYves\n-- \ngit clone git://perl5.git.perl.org/perl\n"},{"id":"98729","messageId":"4954DFCC.8010707@lsrfire.ath.cx","threadId":"16870","inReplyTo":"9b18b3110812260350q6870700du982ec3a7a91950e2@mail.gmail.com","subject":"Re: Why does git-describe warn about something that you can't control?","fromName":"René Scharfe","fromEmail":"rene.scharfe@lsrfire.ath.cx","sentAt":"2008-12-26T13:44:44Z","receivedAt":"2008-12-26T13:44:44Z","isPatch":false,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"demerphq schrieb:\n> On the perl.git repo if I use git-describe --all on some commits I get\n> warnings like this:\n> \n> $ git describe --all 3417e4f8422bcf13f799ce1acef44b27ccbef3d8\n> warning: tag 'perl-5.005_04' is really 'tags/perl-5.005_04' here\n> perl-5.005_04\n> \n> Except there doesnt seem to be any explanation for why the warning is\n> being produced (it almost, but not quite looks random for the commits\n> im looking at), how to silence it, or how to force git-describe to for\n> instance use \"tags/perl-5.8.0\" instead so the warning is not\n> generated.\n> \n> I think this behaviour is confusing, either the warning should go\n> away, or it should be improved and complemented by a switch to force\n> git-describe to use the qualified tagname instead, or at the very\n> least a switch to silence the warning (which is really annoying when\n> you are doing git-describe on hundreds of commits in a go).\n\nThe warning was introduced by 212945d4 (\"Teach git-describe to verify\nannotated tag names before output\") by Shawn (cc:'d).\n\nThe following patch should fix your issue by making describe ignore the\n\"tags/\" path prefix of, well, tags, which is only present if you call\nit with the option --all.\n\ndiff --git a/builtin-describe.c b/builtin-describe.c\nindex d2cfb1b..3a007ed 100644\n--- a/builtin-describe.c\n+++ b/builtin-describe.c\n@@ -158,7 +158,7 @@ static void display_name(struct commit_name *n)\n \t\tn->tag = lookup_tag(n->sha1);\n \t\tif (!n->tag || parse_tag(n->tag) || !n->tag->tag)\n \t\t\tdie(\"annotated tag %s not available\", n->path);\n-\t\tif (strcmp(n->tag->tag, n->path))\n+\t\tif (strcmp(n->tag->tag, all ? n->path + 5 : n->path))\n \t\t\twarning(\"tag '%s' is really '%s' here\", n->tag->tag, n->path);\n \t}\n \n"}]}