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

[PATCH] git verify-pack -vs

From
DDDaniel DeLorme <dan-ml@dan42.com>
Date
Sep 25, 2010, 05:45 UTC
Message-ID
<4C9D8C79.2040101@dan42.com>

According to git help verify-pack, when --stat-only and --verbose are used together the "list of objects is also shown." But in fact it is not; `git verify-pack -sv` has the same behavior as `git verify-pack -s` It seems like a trivial mistake in verify-pack.c (the verbose behavior is triggered with !stat_only) so here is a patch that makes the behavior fit the manual's description.

-- Daniel DeLorme

diff --git a/builtin/verify-pack.c b/builtin/verify-pack.c
index b6079ae..ad67eb8 100644
--- a/builtin/verify-pack.c
+++ b/builtin/verify-pack.c
@@ -13,6 +13,7 @@ static void show_pack_info(struct packed_git *p, unsigned int flags)
 {
 	uint32_t nr_objects, i;
 	int cnt;
+	int verbose = flags & VERIFY_PACK_VERBOSE;
 	int stat_only = flags & VERIFY_PACK_STAT_ONLY;
 	unsigned long chain_histogram[MAX_CHAIN+1], baseobjects;
 
@@ -36,16 +37,16 @@ static void show_pack_info(struct packed_git *p, unsigned int flags)
 		type = packed_object_info_detail(p, offset, &size, &store_size,
 						 &delta_chain_length,
 						 base_sha1);
-		if (!stat_only)
+		if (verbose)
 			printf("%s ", sha1_to_hex(sha1));
 		if (!delta_chain_length) {
-			if (!stat_only)
+			if (verbose)
 				printf("%-6s %lu %lu %"PRIuMAX"\n",
 				       type, size, store_size, (uintmax_t)offset);
 			baseobjects++;
 		}
 		else {
-			if (!stat_only)
+			if (verbose)
 				printf("%-6s %lu %lu %"PRIuMAX" %u %s\n",
 				       type, size, store_size, (uintmax_t)offset,
 				       delta_chain_length, sha1_to_hex(base_sha1));
Message 1 of 1 in “git verify-pack -vs”
  1. git verify-pack -vsDaniel DeLorme, Sep 25, 2010

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.