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

[PATCH 1/3] builtin-pack-objects: don't fail, if delta is not possible

From
MKMartin Koegler <mkoegler@auto.tuwien.ac.at>
Date
May 28, 2007, 21:20 UTC
Message-ID
<11803872591522-git-send-email-mkoegler@auto.tuwien.ac.at>

If builtin-pack-objects runs out of memory while finding the best deltas, it bails out with an error.

If the delta index creation fails (because there is not enough memory), we can downgrade the error message to a warning and continue with the next object.

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
---
The patches apply on top of next.
 builtin-pack-objects.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index e52332d..17627b3 100644
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
@@ -1454,8 +1454,12 @@ static int try_delta(struct unpacked *trg, struct unpacked *src,
 	}
 	if (!src->index) {
 		src->index = create_delta_index(src->data, src_size);
-		if (!src->index)
-			die("out of memory");
+		if (!src->index) {
+			static int warned = 0;
+			if (!warned++)
+				warning("suboptimal pack - out of memory");
+			return 0;
+		}
 	}
 
 	delta_buf = create_delta(src->index, trg->data, trg_size, &delta_size, max_size);
-- 
1.5.2.846.g9a144
Next: Martin Koegler
Message 1 of 6 in “builtin-pack-objects: don't fail, if delta is not possible”
  1. 1/3 builtin-pack-objects: don't fail, if delta is not possibleMartin Koegler, May 28, 2007
  2. 2/3 git-pack-objects: cache small deltas between big objectsMartin Koegler, May 28, 2007
  3. 3/3 builtin-pack-object: cache small deltasMartin Koegler, May 28, 2007
  4. Dana HowMay 29, 2007
  5. Nicolas PitreMay 29, 2007
  6. Shawn O. PearceMay 29, 2007

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.