From: Junio C Hamano <gitster@pobox.com>
To: "Shawn O. Pearce" <spearce@spearce.org>
Cc: git@vger.kernel.org
Subject: git-describe: use tags found in packed-refs correctly
Date: Mon, 03 Mar 2008 09:13:59 -0800 [thread overview]
Message-ID: <7vejarivc8.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <20080228062236.GA15845@spearce.org> (Shawn O. Pearce's message of "Thu, 28 Feb 2008 01:22:36 -0500")
When your refs are packed, "git-describe" can find the tag that is the
best match without ever parsing the tag itself. But lookup_tag() in
display_name() says "I've never seen it", creates an empty shell, and
returns it. We need to make sure that we actually have parsed the tag
data into it.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
builtin-describe.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/builtin-describe.c b/builtin-describe.c
index 2f1e7ba..c549d36 100644
--- a/builtin-describe.c
+++ b/builtin-describe.c
@@ -156,7 +156,7 @@ static void display_name(struct commit_name *n)
{
if (n->prio == 2 && !n->tag) {
n->tag = lookup_tag(n->sha1);
- if (!n->tag || !n->tag->tag)
+ if (parse_tag(n->tag) || !n->tag || !n->tag->tag)
die("annotated tag %s not available", n->path);
if (strcmp(n->tag->tag, n->path))
warning("tag '%s' is really '%s' here", n->tag->tag, n->path);
prev parent reply other threads:[~2008-03-03 17:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-28 6:22 [PATCH] Teach git-describe to verify annotated tag names before output Shawn O. Pearce
2008-03-03 17:13 ` Junio C Hamano [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vejarivc8.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=spearce@spearce.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).