Skip to content

Commit

Permalink
count-objects -v: show number of packs as well.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Dec 27, 2006
1 parent e8b4029 commit ae72f68
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Documentation/git-count-objects.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ OPTIONS
-v::
In addition to the number of loose objects and disk
space consumed, it reports the number of in-pack
objects, and number of objects that can be removed by
running `git-prune-packed`.
objects, number of packs, and number of objects that can be
removed by running `git-prune-packed`.


Author
Expand Down
3 changes: 3 additions & 0 deletions builtin-count-objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit ae72f68

Please sign in to comment.