Avoid incorrect output of UNINTERESTING commits when clock skew occurs
commitcfebad058c7786e3d584669868ee74c2d7118e1f
authorShawn O. Pearce <spearce@spearce.org>
Fri, 13 Mar 2009 02:07:42 +0000 (12 19:07 -0700)
committerRobin Rosenberg <robin.rosenberg@dewire.com>
Sun, 15 Mar 2009 11:48:39 +0000 (15 12:48 +0100)
treee6119328007d8294711f6b2b4fbd8eb17974efb2
parentce820cc79f656c4d3da16955683836e5faec3ebd
Avoid incorrect output of UNINTERESTING commits when clock skew occurs

The prior commit added functionality to scan a few extra commits when
we otherwise would have aborted due to everything left being colored
UNINTERESTING.  When that happens we may wind up coloring a commit
that we already produced to the caller, giving the caller an incorrect
result set.

If we insert a fully buffered generator in the pipeline, such as that
used for RevSort.TOPO or RevSort.REVERSE, we can easily filter these
late-colored commits out before we show them to the application.  But
otherwise we delay the output by 6 commits, just long enough to give
PendingGenerator a reasonable chance at getting the coloring right.

This is only an approximation.  It is still possible for commits to
produce when they should be UNINTERESTING, such as if more than the
OVER_SCAN limit had clock skew between two branches and the common
merge base, even if we are fully buffering our output.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
org.spearce.jgit/src/org/spearce/jgit/revwalk/DelayRevQueue.java [new file with mode: 0644]
org.spearce.jgit/src/org/spearce/jgit/revwalk/FixUninterestingGenerator.java [new file with mode: 0644]
org.spearce.jgit/src/org/spearce/jgit/revwalk/PendingGenerator.java
org.spearce.jgit/src/org/spearce/jgit/revwalk/StartGenerator.java