Re: [PATCH] receive-pack, fetch-pack: reject bogus pack that records objects twice

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH] receive-pack, fetch-pack: reject bogus pack that records objects twice

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:52:30

Jeff King [off-list ref] writes:
If we are fixing a thin pack (which should be the case most of the
time), we are rewriting the packfile anyway. Shouldn't we just omit
the duplicate?
Excising unwanted objects from the middle of an existing packfile would
mean you would need an equivalent of memmove() in the file, which amounts
to really rewriting the packfile, but the thing is, we are _not_ rewriting
in that sense in "index-pack --fix-thin"; it only appends and adjust the
fixed-size header.

Re: [PATCH] receive-pack, fetch-pack: reject bogus pack that records objects twice

From: Jeff King <hidden>
Date: 2016-06-15 22:52:30

On Fri, Nov 18, 2011 at 10:41:35AM -0800, Junio C Hamano wrote:
Jeff King [off-list ref] writes:
quoted
If we are fixing a thin pack (which should be the case most of the
time), we are rewriting the packfile anyway. Shouldn't we just omit
the duplicate?
Excising unwanted objects from the middle of an existing packfile would
mean you would need an equivalent of memmove() in the file, which amounts
to really rewriting the packfile, but the thing is, we are _not_ rewriting
in that sense in "index-pack --fix-thin"; it only appends and adjust the
fixed-size header.
I thought we took the packfile over --stdin, and we really were
writing the entire thing to disk as we processed it. So we could just
suppress writing the second entry. But I guess there is some complexity
with deltified entries? As in, if the first entry is deltified but the
second is not, you would want to keep the second one?

I'm not complaining if it's really too hard to do in practice, or not
worth the trouble. I just still don't understand what is causing these
and when it would come up.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help