]> source.dussan.org Git - jgit.git/commitdiff
Disable topological sorting in PackWriter 85/885/3
authorShawn O. Pearce <spearce@spearce.org>
Tue, 15 Jun 2010 01:31:14 +0000 (18:31 -0700)
committerShawn O. Pearce <spearce@spearce.org>
Thu, 24 Jun 2010 00:32:41 +0000 (17:32 -0700)
Its not strictly required that we sort topologically in order to
produce a valid pack file.  This was just something that Linus
thought would be a good idea to do.  In practice its not that
important for most repositories.  Local file IO quickly falls
out of the pattern that topological sorting provides any sort
of benefit for, so expending extra resources to enforce it when
we make a pack isn't really worth it.

I'm removing this sort in the pipeline because later changes
would support really efficient COMMIT_TIME_DESC sorting on a
non-file storage system, but TOPO sorting would be a bit more
ugly to run, due to the in-memory delays it imposes.

Change-Id: I0121453461c2140c6917cb10c6df584eb47e5795
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.eclipse.jgit/src/org/eclipse/jgit/lib/PackWriter.java

index 75cc4662e0a1edbcc39f64c24bf6dae3155d5e54..e8e5fc21e69c7a1aaf8fb7059996e58e186b92d2 100644 (file)
@@ -821,8 +821,7 @@ public class PackWriter {
                        IncorrectObjectTypeException {
                final ObjectWalk walker = new ObjectWalk(db);
                walker.setRetainBody(false);
-               walker.sort(RevSort.TOPO);
-               walker.sort(RevSort.COMMIT_TIME_DESC, true);
+               walker.sort(RevSort.COMMIT_TIME_DESC);
                if (thin)
                        walker.sort(RevSort.BOUNDARY, true);