diff --git a/pack-objects.c b/pack-objects.c index 523a1c7..8ff7f30 100644 --- a/pack-objects.c +++ b/pack-objects.c @@ -1116,8 +1116,10 @@ static void find_deltas(struct object_en if (!n->index) die("out of memory"); +fprintf(stderr, "trg %s\n", sha1_to_hex(entry->sha1)); j = window; while (--j > 0) { + int rc; unsigned int other_idx = idx + j; struct unpacked *m; if (other_idx >= window) @@ -1125,10 +1127,15 @@ static void find_deltas(struct object_en m = array + other_idx; if (!m->entry) break; - if (try_delta(n, m, m->index, depth) < 0) + rc = try_delta(n, m, m->index, depth); +fprintf(stderr, "% d src %s depth %d delta_sz %d\n", rc, sha1_to_hex(m->entry->sha1), m->entry->depth, n->entry->delta_size); + if (rc < 0) break; } +static int nbdelta=0, deltasz=0; +if (n->entry->delta) nbdelta++, deltasz += n->entry->delta_size; +fprintf(stderr, "nbdelta = %d deltasz = %d\n", nbdelta, deltasz); #if 1 /* if we made n a delta, and if n is already at max * depth, leaving it in the window is pointless. we * should evict it first.