git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[JGIT PATCH] Fix sorting of thin packs in PackWriter

From
Shawn O. Pearce <spearce@spearce.org>
Date
Mar 13, 2009, 15:45 UTC
Message-ID
<1236959125-3789-1-git-send-email-spearce@spearce.org>

We must retain the TOPO and COMMIT_TIME_DESC rules when we add in BOUNDARY for a thin pack, otherwise the resulting thin pack won't match the expected ordering.

Its a non-critical error to sort the pack wrong, but it may cause the client to skip around the pack data more frequently during access.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
 .../src/org/spearce/jgit/lib/PackWriter.java       |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/PackWriter.java b/org.spearce.jgit/src/org/spearce/jgit/lib/PackWriter.java
index f9945c4..b878409 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/PackWriter.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/PackWriter.java
@@ -765,10 +765,10 @@ private ObjectWalk setUpWalker(
 			throws MissingObjectException, IOException,
 			IncorrectObjectTypeException {
 		final ObjectWalk walker = new ObjectWalk(db);
-		walker.sort(RevSort.TOPO, true);
+		walker.sort(RevSort.TOPO);
 		walker.sort(RevSort.COMMIT_TIME_DESC, true);
 		if (thin)
-			walker.sort(RevSort.BOUNDARY);
+			walker.sort(RevSort.BOUNDARY, true);
 
 		for (ObjectId id : interestingObjects) {
 			RevObject o = walker.parseAny(id);
-- 
1.6.2.288.gc3f22
Message 1 of 1 in “Fix sorting of thin packs in PackWriter”
  1. Fix sorting of thin packs in PackWriterShawn O. Pearce, Mar 13, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.