@matheusbsbs / matheus-bagliano / commits / be7db6e574
Fork 0

revision: Fix --topo-order and --max-age with reachability limiting.

What ends up not working very well at all is the combination of "--topo-order" and the output filter in get_revision. It will return NULL when we see the first commit out of date-order, even if we have other commits coming. So we really should do the "past the date order" thing in get_revision() only if we have _not_ done it already in limit_list(). Something like this. The easiest way to test this is with just gitk --since=3.days.ago on the kernel tree. Without this patch, it tends to be pretty obviously broken. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>

Linus Torvalds committed Apr 1, 2006 at 16:35 UTC be7db6e574b95c70ac544c78d74fdeea0fb4058d
1 file changed +6 -4
revision.c
+6 -4
@@ -783,10 +783,14 @@ struct commit *get_revision(struct rev_info *revs)
783
784 /*
785 * If we haven't done the list limiting, we need to look at
786 - * the parents here
786 + * the parents here. We also need to do the date-based limiting
787 + * that we'd otherwise have done in limit_list().
788 */
788 - if (!revs->limited)
789 + if (!revs->limited) {
790 + if (revs->max_age != -1 && (commit->date < revs->max_age))
791 + continue;
792 add_parents_to_list(revs, commit, &revs->commits);
793 + }
794 if (commit->object.flags & SHOWN)
795 continue;
796 if (!(commit->object.flags & BOUNDARY) &&
@@ -794,8 +798,6 @@ struct commit *get_revision(struct rev_info *revs)
798 continue;
799 if (revs->min_age != -1 && (commit->date > revs->min_age))
800 continue;
797 - if (revs->max_age != -1 && (commit->date < revs->max_age))
798 - return NULL;
801 if (revs->no_merges &&
802 commit->parents && commit->parents->next)
803 continue;