pack-objects: include number of packs reused in output

In addition to including the number of objects reused verbatim from a reuse-pack, include the number of packs from which objects were reused. Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Taylor Blau committed Dec 14, 2023 at 17:24 UTC b96289a10b6577c8fb60b425dbd009f6966622f8
1 file changed +6 -2
builtin/pack-objects.c
+6 -2
@@ -223,6 +223,7 @@ static struct progress *progress_state;
223
224 static struct bitmapped_pack *reuse_packfiles;
225 static size_t reuse_packfiles_nr;
226 +static size_t reuse_packfiles_used_nr;
227 static uint32_t reuse_packfile_objects;
228 static struct bitmap *reuse_packfile_bitmap;
229
@@ -1265,6 +1266,8 @@ static void write_pack_file(void)
1266 for (j = 0; j < reuse_packfiles_nr; j++) {
1267 reused_chunks_nr = 0;
1268 write_reused_pack(&reuse_packfiles[j], f);
1269 + if (reused_chunks_nr)
1270 + reuse_packfiles_used_nr++;
1271 }
1272 offset = hashfile_total(f);
1273 }
@@ -4587,9 +4590,10 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
4590 fprintf_ln(stderr,
4591 _("Total %"PRIu32" (delta %"PRIu32"),"
4592 " reused %"PRIu32" (delta %"PRIu32"),"
4590 - " pack-reused %"PRIu32),
4593 + " pack-reused %"PRIu32" (from %"PRIuMAX")"),
4594 written, written_delta, reused, reused_delta,
4592 - reuse_packfile_objects);
4595 + reuse_packfile_objects,
4596 + (uintmax_t)reuse_packfiles_used_nr);
4597
4598 cleanup:
4599 clear_packing_data(&to_pack);