]> git.pld-linux.org Git - packages/git-core.git/blob - git-core-coequal.patch
ca15404e3b896c62722c4431dcb9456db4b9b6ec
[packages/git-core.git] / git-core-coequal.patch
1 commit c19d1b4e840535c5fc27077194e8ac219c02644c
2 Author: Kacper Kornet <draenog@pld-linux.org>
3 Date:   Fri Mar 22 19:38:19 2013 +0100
4
5     Fix revision walk for commits with the same dates
6     
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.
14     
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.
18     
19     Signed-off-by: Kacper Kornet <draenog@pld-linux.org>
20     Signed-off-by: Junio C Hamano <gitster@pobox.com>
21
22 diff --git a/revision.c b/revision.c
23 index 68545c8..6a9a8b3 100644
24 --- a/revision.c
25 +++ b/revision.c
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.
29          */
30 -       if (date < src->item->date)
31 +       if (date <= src->item->date)
32                 return SLOP;
33  
34         /*
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
42  '
43 +
44 +test_expect_success 'ancestors with the same commit time' '
45 +
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
49 +               test_commit t$i
50 +       done &&
51 +       git rev-list t1^! --not t$i >result &&
52 +       >expect &&
53 +       test_cmp expect result
54 +'
55 +
56  test_done
This page took 0.080286 seconds and 2 git commands to generate.