{"thread":{"id":"25237","subject":"[PATCH] git verify-pack -vs","startedAt":"2010-09-25T05:45:29Z","lastAt":"2010-09-25T05:45:29Z","messageCount":1,"participants":["Daniel DeLorme"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"151613","messageId":"4C9D8C79.2040101@dan42.com","threadId":"25237","inReplyTo":null,"subject":"[PATCH] git verify-pack -vs","fromName":"Daniel DeLorme","fromEmail":"dan-ml@dan42.com","sentAt":"2010-09-25T05:45:29Z","receivedAt":"2010-09-25T05:45:29Z","isPatch":true,"sender":{"key":"dan-ml@dan42.com","avatar":null},"body":"According to git help verify-pack, when --stat-only and --verbose are \nused together the \"list of objects is also shown.\" But in fact it is \nnot; `git verify-pack -sv` has the same behavior as `git verify-pack -s`\nIt seems like a trivial mistake in verify-pack.c (the verbose behavior \nis triggered with !stat_only) so here is a patch that makes the behavior \nfit the manual's description.\n\n--\nDaniel DeLorme\n\n\ndiff --git a/builtin/verify-pack.c b/builtin/verify-pack.c\nindex b6079ae..ad67eb8 100644\n--- a/builtin/verify-pack.c\n+++ b/builtin/verify-pack.c\n@@ -13,6 +13,7 @@ static void show_pack_info(struct packed_git *p, unsigned int flags)\n {\n \tuint32_t nr_objects, i;\n \tint cnt;\n+\tint verbose = flags & VERIFY_PACK_VERBOSE;\n \tint stat_only = flags & VERIFY_PACK_STAT_ONLY;\n \tunsigned long chain_histogram[MAX_CHAIN+1], baseobjects;\n \n@@ -36,16 +37,16 @@ static void show_pack_info(struct packed_git *p, unsigned int flags)\n \t\ttype = packed_object_info_detail(p, offset, &size, &store_size,\n \t\t\t\t\t\t &delta_chain_length,\n \t\t\t\t\t\t base_sha1);\n-\t\tif (!stat_only)\n+\t\tif (verbose)\n \t\t\tprintf(\"%s \", sha1_to_hex(sha1));\n \t\tif (!delta_chain_length) {\n-\t\t\tif (!stat_only)\n+\t\t\tif (verbose)\n \t\t\t\tprintf(\"%-6s %lu %lu %\"PRIuMAX\"\\n\",\n \t\t\t\t       type, size, store_size, (uintmax_t)offset);\n \t\t\tbaseobjects++;\n \t\t}\n \t\telse {\n-\t\t\tif (!stat_only)\n+\t\t\tif (verbose)\n \t\t\t\tprintf(\"%-6s %lu %lu %\"PRIuMAX\" %u %s\\n\",\n \t\t\t\t       type, size, store_size, (uintmax_t)offset,\n \t\t\t\t       delta_chain_length, sha1_to_hex(base_sha1));\n"}]}