summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 053fd0c)
raw | patch | inline | side by side (parent: 053fd0c)
author | Marcus Griep <marcus@griep.us> | |
Fri, 15 Aug 2008 04:20:20 +0000 (00:20 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 17 Aug 2008 08:01:42 +0000 (01:01 -0700) |
Adds the total pack size (including indexes) the verbose count-objects
output, floored to the nearest kilobyte.
Updates documentation to match this addition.
Signed-off-by: Marcus Griep <marcus@griep.us>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
output, floored to the nearest kilobyte.
Updates documentation to match this addition.
Signed-off-by: Marcus Griep <marcus@griep.us>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 91b5487478998e39bb8ae4a5cb667360cff82c9a..249040b96a44d4e2ca591c7bfd9742afc251cf21 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 / 2);
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)" '