summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c14261e)
raw | patch | inline | side by side (parent: c14261e)
author | Shawn O. Pearce <spearce@spearce.org> | |
Sat, 13 Jan 2007 22:27:52 +0000 (17:27 -0500) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Mon, 15 Jan 2007 05:17:27 +0000 (21:17 -0800) |
Several people have suggested that its always better to describe
a commit using an annotated tag, and to only use a lightweight tag
if absolutely no annotated tag matches the input commit.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
a commit using an annotated tag, and to only use a lightweight tag
if absolutely no annotated tag matches the input commit.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
builtin-describe.c | patch | blob | history |
diff --git a/builtin-describe.c b/builtin-describe.c
index a8c98cea163a28cafb9b23861bd976b6354c2def..ad672aa8ee7b2f791881d8aa7ec9084a68ac6c8c 100644 (file)
--- a/builtin-describe.c
+++ b/builtin-describe.c
commit_list_insert(cmit, &list);
while (list) {
struct commit *c = pop_commit(&list);
+ struct commit_list *parents = c->parents;
n = match(c);
if (n) {
struct possible_tag *p = xmalloc(sizeof(*p));
else
all_matches = p;
cur_match = p;
- } else {
- struct commit_list *parents = c->parents;
- while (parents) {
- struct commit *p = parents->item;
- parse_commit(p);
- if (!(p->object.flags & SEEN)) {
- p->object.flags |= SEEN;
- insert_by_date(p, &list);
- }
- parents = parents->next;
+ if (n->prio == 2)
+ continue;
+ }
+ while (parents) {
+ struct commit *p = parents->item;
+ parse_commit(p);
+ if (!(p->object.flags & SEEN)) {
+ p->object.flags |= SEEN;
+ insert_by_date(p, &list);
}
+ parents = parents->next;
}
}
while ((!min_match || cur_match->depth < min_match->depth)
&& get_revision(&revs))
cur_match->depth++;
- if (!min_match || cur_match->depth < min_match->depth)
+ if (!min_match || (cur_match->depth < min_match->depth
+ && cur_match->name->prio >= min_match->name->prio))
min_match = cur_match;
free_commit_list(revs.commits);
}