summaryrefslogtreecommitdiff
path: root/builtin-describe.c
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2008-10-13 07:39:46 -0700
committerJunio C Hamano <gitster@pobox.com>2008-10-17 11:35:43 -0700
commit7e425c4fbbe9affffa822f154d8bb2d0da6699ef (patch)
tree1dc1da95ff2740e01d0dc69ef471f6855ae866fa /builtin-describe.c
parent5c283eb13c94be6ca974aa722159dc9838d10d97 (diff)
downloadgit-7e425c4fbbe9affffa822f154d8bb2d0da6699ef.tar.gz
describe: Make --tags and --all match lightweight tags more often
If the caller supplies --tags they want the lightweight, unannotated tags to be searched for a match. If a lightweight tag is closer in the history, it should be matched, even if an annotated tag is reachable further back in the commit chain. The same applies with --all when matching any other type of ref. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Acked-By: Uwe Kleine-König <ukleinek@strlen.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-describe.c')
-rw-r--r--builtin-describe.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/builtin-describe.c b/builtin-describe.c
index ec404c839b..d2cfb1b083 100644
--- a/builtin-describe.c
+++ b/builtin-describe.c
@@ -15,8 +15,8 @@ static const char * const describe_usage[] = {
};
static int debug; /* Display lots of verbose info */
-static int all; /* Default to annotated tags only */
-static int tags; /* But allow any tags if --tags is specified */
+static int all; /* Any valid ref can be used */
+static int tags; /* Allow lightweight tags */
static int longformat;
static int abbrev = DEFAULT_ABBREV;
static int max_candidates = 10;
@@ -112,8 +112,6 @@ static int compare_pt(const void *a_, const void *b_)
{
struct possible_tag *a = (struct possible_tag *)a_;
struct possible_tag *b = (struct possible_tag *)b_;
- if (a->name->prio != b->name->prio)
- return b->name->prio - a->name->prio;
if (a->depth != b->depth)
return a->depth - b->depth;
if (a->found_order != b->found_order)