summaryrefslogtreecommitdiff
path: root/builtin-count-objects.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-12-27 01:04:03 -0800
committerJunio C Hamano <junkio@cox.net>2006-12-27 01:05:00 -0800
commitae72f685418b79bbd67e1017c5b1ac7d731c042e (patch)
tree527b09ab4f3d01fc91ca1f10a6deadffcc01ce14 /builtin-count-objects.c
parente8b4029f990907e24fac0e7772ee19ee6dd55c1c (diff)
downloadgit-ae72f685418b79bbd67e1017c5b1ac7d731c042e.tar.gz
count-objects -v: show number of packs as well.
Recent "git push" keeps transferred objects packed much more aggressively than before. Monitoring output from git-count-objects -v for number of loose objects is not enough to decide when to repack -- having too many small packs is also a good cue for repacking. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'builtin-count-objects.c')
-rw-r--r--builtin-count-objects.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/builtin-count-objects.c b/builtin-count-objects.c
index 73c5982423..f5b22bb80e 100644
--- a/builtin-count-objects.c
+++ b/builtin-count-objects.c
@@ -105,16 +105,19 @@ int cmd_count_objects(int ac, const char **av, const char *prefix)
}
if (verbose) {
struct packed_git *p;
+ unsigned long num_pack = 0;
if (!packed_git)
prepare_packed_git();
for (p = packed_git; p; p = p->next) {
if (!p->pack_local)
continue;
packed += num_packed_objects(p);
+ num_pack++;
}
printf("count: %lu\n", loose);
printf("size: %lu\n", loose_size / 2);
printf("in-pack: %lu\n", packed);
+ printf("packs: %lu\n", num_pack);
printf("prune-packable: %lu\n", packed_loose);
printf("garbage: %lu\n", garbage);
}