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

[PATCH take 2] change the unpack limit treshold to a saner value

From
Nicolas Pitre <nico@cam.org>
Date
Dec 7, 2006, 04:01 UTC
Message-ID
<Pine.LNX.4.64.0612062244090.2630@xanadu.home>
In-Reply-To
<Pine.LNX.4.64.0612061420410.2630@xanadu.home>

Currently the treshold is 5000. The likelihood of this value to ever be crossed for a single push is really small making it not really useful.

The optimal treshold for a pure space saving on a filesystem with 4kb blocks is 3. However this is likely to create many small packs concentrating a large number of files in a single directory compared to the same objects which are spread over 256 directories when loose. This means we would need 512 objects per pack on average to approximagte the same directory cost (a pack has 2 files because of the index).

But 512 is a really high value just like 5000 since most pushes are unlikely to have that many objects. So let's try with a value of 100 which should have a good balance between small pushes going to be exploded into loose objects and large pushes kept as whole packs.

This is not a replacement for periodic repacks of course.
Signed-off-by: Nicolas Pitre <nico@cam.org>
---
diff --git a/receive-pack.c b/receive-pack.c
index d62ed5b..9140312 100644
--- a/receive-pack.c
+++ b/receive-pack.c
@@ -11,7 +11,7 @@
 static const char receive_pack_usage[] = "git-receive-pack <git-dir>";
 
 static int deny_non_fast_forwards = 0;
-static int unpack_limit = 5000;
+static int unpack_limit = 100;
 static int report_status;
 
Previous: Linus TorvaldsNext: Shawn Pearce
Message 7 of 8 in “change the unpack limit treshold to a saner value”
  1. change the unpack limit treshold to a saner valueNicolas Pitre, Dec 6, 2006
  2. Junio C HamanoDec 6, 2006
  3. Nicolas PitreDec 7, 2006
  4. Linus TorvaldsDec 7, 2006
  5. Nicolas PitreDec 7, 2006
  6. Linus TorvaldsDec 7, 2006
  7. change the unpack limit treshold to a saner valueNicolas Pitre, Dec 7, 2006
  8. Shawn PearceDec 7, 2006

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.