Code

Merge branch 'sp/describe-tag'
authorJunio C Hamano <gitster@pobox.com>
Sun, 2 Mar 2008 23:19:59 +0000 (15:19 -0800)
committerJunio C Hamano <gitster@pobox.com>
Sun, 2 Mar 2008 23:19:59 +0000 (15:19 -0800)
* sp/describe-tag:
  Teach git-describe to verify annotated tag names before output

Conflicts:

builtin-describe.c

1  2 
builtin-describe.c

index 2342913df622f6759fd45b58e5ee2899ade9fbfb,08d18507ac99a6c852f04d5b069857347dc5c0b8..2f1e7ba150098dfa85c8ffe009b318c22bedcbbd
@@@ -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];