Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

Re: [PATCH] fix repack with --max-pack-size

From: Dana How <hidden>
Date: 2016-06-15 22:43:13

On 5/30/07, Nicolas Pitre [off-list ref] wrote:
Two issues here:

1) git-repack -a --max-pack-size=10 on the GIT repo dies pretty quick.
   There is a lot of confusion about deltas that were suposed to be
   reused from another pack but that get stored undeltified due to pack
   limit and object size doesn't match entry->size anymore.  This test
   is not really worth the complexity for determining when it is valid
   so get rid of it.
This is very real.  A smaller fix would have been the hunk
@@ -408,7 +407,7 @@ static unsigned long write_object(struct sha1file *f,
              buf = read_sha1_file(entry->sha1, &type, &size);
              if (!buf)
                      die("unable to read %s", sha1_to_hex(entry->sha1));
-               if (size != entry->size)
+               if (size != entry->size && type == obj_type)
                      die("object %s size inconsistency (%lu vs %lu)",
                          sha1_to_hex(entry->sha1), size, entry->size);
              if (usable_delta) {
from the max-blob-size patch that hasn't converged yet.

Both pack splitting and blob-size limiting could cause a delta base
not to appear in the pack containing a delta using the base.
Then you get the size mismatch Nicolas discussed
when the real object must be used and its size doesn't match
the delta sized stored in the size field.
I first saw this with max-blob-size,  but only realized recently
that it also applied to max-pack-size.  Sorry I didn't post a patch;
we are swamped at the moment.

ACK [but I didn't review (2)].

Thanks,
-- 
Dana L. How  danahow@gmail.com  +1 650 804 5991 cell
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help