summaryrefslogtreecommitdiffstats
path: root/builtin/pack-objects.c
diff options
context:
space:
mode:
authorTaylor Blau <me@ttaylorr.com>2023-12-14 23:24:20 +0100
committerJunio C Hamano <gitster@pobox.com>2023-12-14 23:38:08 +0100
commitb96289a10b6577c8fb60b425dbd009f6966622f8 (patch)
tree35ba8a98d48d9621f651a53994230ac638ef33ee /builtin/pack-objects.c
parentpack-objects: prepare `write_reused_pack_verbatim()` for multi-pack reuse (diff)
downloadgit-b96289a10b6577c8fb60b425dbd009f6966622f8.tar.xz
git-b96289a10b6577c8fb60b425dbd009f6966622f8.zip
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>
Diffstat (limited to 'builtin/pack-objects.c')
-rw-r--r--builtin/pack-objects.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index 31053128fc..7eb035eb7d 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -223,6 +223,7 @@ static struct progress *progress_state;
static struct bitmapped_pack *reuse_packfiles;
static size_t reuse_packfiles_nr;
+static size_t reuse_packfiles_used_nr;
static uint32_t reuse_packfile_objects;
static struct bitmap *reuse_packfile_bitmap;
@@ -1265,6 +1266,8 @@ static void write_pack_file(void)
for (j = 0; j < reuse_packfiles_nr; j++) {
reused_chunks_nr = 0;
write_reused_pack(&reuse_packfiles[j], f);
+ if (reused_chunks_nr)
+ reuse_packfiles_used_nr++;
}
offset = hashfile_total(f);
}
@@ -4587,9 +4590,10 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
fprintf_ln(stderr,
_("Total %"PRIu32" (delta %"PRIu32"),"
" reused %"PRIu32" (delta %"PRIu32"),"
- " pack-reused %"PRIu32),
+ " pack-reused %"PRIu32" (from %"PRIuMAX")"),
written, written_delta, reused, reused_delta,
- reuse_packfile_objects);
+ reuse_packfile_objects,
+ (uintmax_t)reuse_packfiles_used_nr);
cleanup:
clear_packing_data(&to_pack);