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

[PATCH] pack-objects: remove redundent status information

From
Nicolas Pitre <nico@cam.org>
Date
Nov 29, 2006, 22:15 UTC
Message-ID
<Pine.LNX.4.64.0611291704440.9647@xanadu.home>

The final 'nr_result' and 'written' values must always be the same otherwise we're in deep trouble. So let's remove a redundent report.

And for paranoia sake let's make sure those two variables are actually equal after all objects are written (one never knows).

Signed-off-by: Nicolas Pitre <nico@cam.org>
---
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index 753bcd5..a2dc7d1 100644
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
@@ -514,6 +514,8 @@ static void write_pack_file(void)
 	if (do_progress)
 		fputc('\n', stderr);
  done:
+	if (written != nr_result)
+		die("wrote %d objects while expecting %d", written, nr_result);
 	sha1close(f, pack_file_sha1, 1);
 }
 
@@ -1662,7 +1664,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
 		}
 	}
 	if (progress)
-		fprintf(stderr, "Total %d, written %d (delta %d), reused %d (delta %d)\n",
-			nr_result, written, written_delta, reused, reused_delta);
+		fprintf(stderr, "Total %d (delta %d), reused %d (delta %d)\n",
+			written, written_delta, reused, reused_delta);
 	return 0;
Message 1 of 1 in “pack-objects: remove redundent status information”
  1. pack-objects: remove redundent status informationNicolas Pitre, Nov 29, 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.