From: Junio C Hamano Date: Sun, 2 Mar 2008 23:19:59 +0000 (-0800) Subject: Merge branch 'sp/describe-tag' X-Git-Tag: v1.5.5-rc0~86 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b00ac8c729258f7117c74838133d57c40536b48b;p=git.git Merge branch 'sp/describe-tag' * sp/describe-tag: Teach git-describe to verify annotated tag names before output Conflicts: builtin-describe.c --- b00ac8c729258f7117c74838133d57c40536b48b diff --cc builtin-describe.c index 2342913df,08d18507a..2f1e7ba15 --- a/builtin-describe.c +++ b/builtin-describe.c @@@ -147,6 -151,22 +152,25 @@@ static unsigned long finish_depth_compu return seen_commits; } + 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) + 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); + } + + if (n->tag) + printf("%s", n->tag->tag); + else + printf("%s", n->path); ++ if (longformat) ++ printf("-0-g%s", ++ find_unique_abbrev(n->tag->tagged->sha1, abbrev)); + } + static void describe(const char *arg, int last_one) { unsigned char sha1[20];