aboutsummaryrefslogtreecommitdiff
path: root/builtin-verify-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-08-07 20:44:49 -0700
committerJunio C Hamano <gitster@pobox.com>2009-08-07 20:44:49 -0700
commit7ecc9b153c89aeec7470256f7b121fd845101b57 (patch)
tree0bf662b5dd1ffe642756f5cb168902a89b60506a /builtin-verify-pack.c
parentc9c3c6781c5b97c37b3ce16af7ea9bc613413c7e (diff)
parent5dc36a5888a7063ff4536c9ea50eb0557bfef627 (diff)
downloadgit-7ecc9b153c89aeec7470256f7b121fd845101b57.tar.gz
git-7ecc9b153c89aeec7470256f7b121fd845101b57.tar.xz
Merge branch 'maint' into jc/verify-pack-stat
* maint: (95 commits) verify-pack -v: do not report "chain length 0" t5510: harden the way verify-pack is used gitweb/README: Document $base_url Documentation: git submodule: add missing options to synopsis Better usage string for reflog. hg-to-git: don't import the unused popen2 module send-email: remove debug trace config: Keep inner whitespace verbatim GIT 1.6.4 GIT 1.6.3.4 config.txt: document add.ignore-errors request-pull: allow ls-remote to notice remote.$nickname.uploadpack Update the documentation of the raw diff output format git-rerere.txt: Clarify ambiguity of the config variable t9143: do not fail if Compress::Zlib is missing Trivial path quoting fixes in git-instaweb GIT 1.6.4-rc3 Documentation/config.txt: a variable can be defined on the section header line git svn: make minimize URL more reliable over http(s) Disable asciidoc 8.4.1+ semantics for `{plus}` and friends ...
Diffstat (limited to 'builtin-verify-pack.c')
-rw-r--r--builtin-verify-pack.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/builtin-verify-pack.c b/builtin-verify-pack.c
index ebd6dff94..b5bd28e95 100644
--- a/builtin-verify-pack.c
+++ b/builtin-verify-pack.c
@@ -8,10 +8,13 @@
static void show_pack_info(struct packed_git *p)
{
- uint32_t nr_objects, i, chain_histogram[MAX_CHAIN+1];
+ uint32_t nr_objects, i;
+ int cnt;
+ unsigned long chain_histogram[MAX_CHAIN+1], baseobjects;
nr_objects = p->num_objects;
memset(chain_histogram, 0, sizeof(chain_histogram));
+ baseobjects = 0;
for (i = 0; i < nr_objects; i++) {
const unsigned char *sha1;
@@ -30,9 +33,11 @@ static void show_pack_info(struct packed_git *p)
&delta_chain_length,
base_sha1);
printf("%s ", sha1_to_hex(sha1));
- if (!delta_chain_length)
+ if (!delta_chain_length) {
printf("%-6s %lu %lu %"PRIuMAX"\n",
type, size, store_size, (uintmax_t)offset);
+ baseobjects++;
+ }
else {
printf("%-6s %lu %lu %"PRIuMAX" %u %s\n",
type, size, store_size, (uintmax_t)offset,
@@ -44,15 +49,21 @@ static void show_pack_info(struct packed_git *p)
}
}
- for (i = 0; i <= MAX_CHAIN; i++) {
- if (!chain_histogram[i])
+ if (baseobjects)
+ printf("non delta: %lu object%s\n",
+ baseobjects, baseobjects > 1 ? "s" : "");
+
+ for (cnt = 1; cnt <= MAX_CHAIN; cnt++) {
+ if (!chain_histogram[cnt])
continue;
- printf("chain length = %"PRIu32": %"PRIu32" object%s\n", i,
- chain_histogram[i], chain_histogram[i] > 1 ? "s" : "");
+ printf("chain length = %d: %lu object%s\n", cnt,
+ chain_histogram[cnt],
+ chain_histogram[cnt] > 1 ? "s" : "");
}
if (chain_histogram[0])
- printf("chain length > %d: %"PRIu32" object%s\n", MAX_CHAIN,
- chain_histogram[0], chain_histogram[0] > 1 ? "s" : "");
+ printf("chain length > %d: %lu object%s\n", MAX_CHAIN,
+ chain_histogram[0],
+ chain_histogram[0] > 1 ? "s" : "");
}
static int verify_one_pack(const char *path, int verbose)