mirror of
https://github.com/git/git
synced 2024-08-28 12:09:19 +00:00
Merge branch 'en/name-rev-make-taggerdate-much-less-important'
"git name-rev" heuristics update. * en/name-rev-make-taggerdate-much-less-important: name-rev: fix names by dropping taggerdate workaround
This commit is contained in:
commit
5fc6d00b65
|
@ -108,19 +108,11 @@ static int is_better_name(struct rev_name *name,
|
||||||
int name_distance = effective_distance(name->distance, name->generation);
|
int name_distance = effective_distance(name->distance, name->generation);
|
||||||
int new_distance = effective_distance(distance, generation);
|
int new_distance = effective_distance(distance, generation);
|
||||||
|
|
||||||
/*
|
/* If both are tags, we prefer the nearer one. */
|
||||||
* When comparing names based on tags, prefer names
|
|
||||||
* based on the older tag, even if it is farther away.
|
|
||||||
*/
|
|
||||||
if (from_tag && name->from_tag)
|
if (from_tag && name->from_tag)
|
||||||
return (name->taggerdate > taggerdate ||
|
return name_distance > new_distance;
|
||||||
(name->taggerdate == taggerdate &&
|
|
||||||
name_distance > new_distance));
|
|
||||||
|
|
||||||
/*
|
/* Favor a tag over a non-tag. */
|
||||||
* We know that at least one of them is a non-tag at this point.
|
|
||||||
* favor a tag over a non-tag.
|
|
||||||
*/
|
|
||||||
if (name->from_tag != from_tag)
|
if (name->from_tag != from_tag)
|
||||||
return from_tag;
|
return from_tag;
|
||||||
|
|
||||||
|
|
|
@ -657,4 +657,10 @@ test_expect_success 'setup: describe commits with disjoint bases 2' '
|
||||||
|
|
||||||
check_describe -C disjoint2 "B-3-gHASH" HEAD
|
check_describe -C disjoint2 "B-3-gHASH" HEAD
|
||||||
|
|
||||||
|
test_expect_success 'setup misleading taggerdates' '
|
||||||
|
GIT_COMMITTER_DATE="2006-12-12 12:31" git tag -a -m "another tag" newer-tag-older-commit unique-file~1
|
||||||
|
'
|
||||||
|
|
||||||
|
check_describe newer-tag-older-commit~1 --contains unique-file~2
|
||||||
|
|
||||||
test_done
|
test_done
|
||||||
|
|
Loading…
Reference in a new issue