author | Shawn O. Pearce <spearce@spearce.org> | |
Sun, 14 Jan 2007 09:37:44 +0000 (04:37 -0500) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Mon, 15 Jan 2007 05:17:27 +0000 (21:17 -0800) | ||
commit | cf69fd49ec815780080dc6a4ee237eee5ffe8745 | |
tree | 7515ec68138f1833e7139c465050e847e8f3d471 | tree | snapshot |
parent | 5312ab11fbf7bac28b671510ac3734a3e604d9fa | commit | diff |
Correct priority of lightweight tags in git-describe.
We really want to always favor an annotated tag over a lightweight
tag when describing a commit. Unfortunately git-describe wasn't
doing this as it was favoring the depth attribute of a possible_tag
over the priority. Now priority is the highest sort and we only
consider a lightweight tag if no annotated tags were identified.
Rather than searching for the minimum tag using a simple loop we
now sort them using a stable sort algorithm, this way the possible
tags display in order if --debug gets used. The stable sort helps
to preseve the inherit topology/date order that we obtain during
our search loop.
This fix allows the tests in t6120-describe.sh to pass.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
We really want to always favor an annotated tag over a lightweight
tag when describing a commit. Unfortunately git-describe wasn't
doing this as it was favoring the depth attribute of a possible_tag
over the priority. Now priority is the highest sort and we only
consider a lightweight tag if no annotated tags were identified.
Rather than searching for the minimum tag using a simple loop we
now sort them using a stable sort algorithm, this way the possible
tags display in order if --debug gets used. The stable sort helps
to preseve the inherit topology/date order that we obtain during
our search loop.
This fix allows the tests in t6120-describe.sh to pass.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
builtin-describe.c | diff | blob | history |