Browse Source

Disable topological sorting in PackWriter

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>
stable-0.9
Shawn O. Pearce 15 years ago
parent
commit
60aae90d4d
  1. 3
      org.eclipse.jgit/src/org/eclipse/jgit/lib/PackWriter.java

3
org.eclipse.jgit/src/org/eclipse/jgit/lib/PackWriter.java

@ -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);

Loading…
Cancel
Save