1 commit c19d1b4e840535c5fc27077194e8ac219c02644c
2 Author: Kacper Kornet <draenog@pld-linux.org>
3 Date: Fri Mar 22 19:38:19 2013 +0100
5 Fix revision walk for commits with the same dates
7 Logic in still_interesting function allows to stop the commits
8 traversing if the oldest processed commit is not older then the
9 youngest commit on the list to process and the list contains only
10 commits marked as not interesting ones. It can be premature when dealing
11 with a set of coequal commits. For example git rev-list A^! --not B
12 provides wrong answer if all commits in the range A..B had the same
13 commit time and there are more then 7 of them.
15 To fix this problem the relevant part of the logic in still_interesting
16 is changed to: the walk can be stopped if the oldest processed commit is
17 younger then the youngest commit on the list to processed.
19 Signed-off-by: Kacper Kornet <draenog@pld-linux.org>
20 Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 diff --git a/revision.c b/revision.c
23 index 68545c8..6a9a8b3 100644
26 @@ -708,7 +708,7 @@ static int still_interesting(struct commit_list *src, unsigned long date, int sl
27 * Does the destination list contain entries with a date
28 * before the source list? Definitely _not_ done.
30 - if (date < src->item->date)
31 + if (date <= src->item->date)
35 diff --git a/t/t6009-rev-list-parent.sh b/t/t6009-rev-list-parent.sh
36 index 3050740..66cda17 100755
37 --- a/t/t6009-rev-list-parent.sh
38 +++ b/t/t6009-rev-list-parent.sh
39 @@ -133,4 +133,17 @@ test_expect_success 'dodecapus' '
40 check_revlist "--min-parents=13" &&
41 check_revlist "--min-parents=4 --max-parents=11" tetrapus
44 +test_expect_success 'ancestors with the same commit time' '
46 + test_tick_keep=$test_tick &&
47 + for i in 1 2 3 4 5 6 7 8; do
48 + test_tick=$test_tick_keep
51 + git rev-list t1^! --not t$i >result &&
53 + test_cmp expect result