author | Junio C Hamano <gitster@pobox.com> | |
Thu, 21 Aug 2008 06:41:54 +0000 (23:41 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 21 Aug 2008 06:41:54 +0000 (23:41 -0700) |
* mg/count-objects:
count-objects: Add total pack size to verbose output
count-objects: Add total pack size to verbose output
Documentation/git-count-objects.txt | patch | blob | history | |
builtin-count-objects.c | patch | blob | history | |
t/t5500-fetch-pack.sh | patch | blob | history |
index 75a8da1ca906aee4cc6a7d0c3ff19862b8e0fc2f..6bc1c21e6283284e2eae16d7ec4cb8183d8e0851 100644 (file)
--verbose::
In addition to the number of loose objects and disk
space consumed, it reports the number of in-pack
- objects, number of packs, and number of objects that can be
- removed by running `git prune-packed`.
+ objects, number of packs, disk space consumed by those packs,
+ and number of objects that can be removed by running
+ `git prune-packed`.
Author
index a1c9eb41cbad932f0438c0c68ca5c3764c78a65c..6e80fe7c016788c178e206c61f5ef3c1fdea506c 100644 (file)
--- a/builtin-count-objects.c
+++ b/builtin-count-objects.c
if (verbose) {
struct packed_git *p;
unsigned long num_pack = 0;
+ unsigned long size_pack = 0;
if (!packed_git)
prepare_packed_git();
for (p = packed_git; p; p = p->next) {
if (open_pack_index(p))
continue;
packed += p->num_objects;
+ size_pack += p->pack_size + p->index_size;
num_pack++;
}
printf("count: %lu\n", loose);
printf("size: %lu\n", loose_size / 1024);
printf("in-pack: %lu\n", packed);
printf("packs: %lu\n", num_pack);
+ printf("size-pack: %lu\n", size_pack / 1024);
printf("prune-packable: %lu\n", packed_loose);
printf("garbage: %lu\n", garbage);
}
diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh
index 362cf7e928090fb3752936317f78a4d128810127..7125baebb891d276ab2a9724b5a6801da7cfc884 100755 (executable)
--- a/t/t5500-fetch-pack.sh
+++ b/t/t5500-fetch-pack.sh
"test \"in-pack: 18\" = \"$(grep in-pack count.shallow)\""
count_output () {
- sed -e '/^in-pack:/d' -e '/^packs:/d' -e '/: 0$/d' "$1"
+ sed -e '/^in-pack:/d' -e '/^packs:/d' -e '/^size-pack:/d' -e '/: 0$/d' "$1"
}
test_expect_success "clone shallow object count (part 2)" '