From: Shawn O. Pearce Date: Sun, 14 Jan 2007 09:37:44 +0000 (-0500) Subject: Correct priority of lightweight tags in git-describe. X-Git-Tag: v1.5.0-rc2~89 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/cf69fd49ec815780080dc6a4ee237eee5ffe8745?hp=cf69fd49ec815780080dc6a4ee237eee5ffe8745 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 Signed-off-by: Junio C Hamano ---