git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Jeff King <peff@peff.net>
Date
Nov 18, 2011, 21:08 UTC
Message-ID
<20111118210825.GA14710@sigill.intra.peff.net>
In-Reply-To
<7v62ihkzhb.fsf@alter.siamese.dyndns.org>
On Fri, Nov 18, 2011 at 11:22:08AM -0800, Junio C Hamano wrote:
Show 16 quoted lines
> >> > 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?
> >> ...
> > ... 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 think you answered your own question here; it is not "some complexity"
> but is exactly the "you need to memmove() in the output file" situation in
> the message you are responding to.
> 
> Upon seeing a delta, you would not know if the same object as this delta
> represents appears later in the pack stream, which means until you read to
> the end you wouldn't know.  You obviously would not want to hold onto all
> deltas in-core to "just omit the duplicate".

OK, that makes sense to me. It's nice to hear it confirmed from somebody who obviously thought more about it.

-Peff
Previous: Junio C HamanoNext: Shawn Pearce
Message 7 of 8 in “receive-pack, fetch-pack: reject bogus pack that records objects twice”
  1. receive-pack, fetch-pack: reject bogus pack that records objects twiceJunio C Hamano, Nov 17, 2011
  2. Shawn PearceNov 17, 2011
  3. Jeff KingNov 18, 2011
  4. Junio C HamanoNov 18, 2011
  5. Jeff KingNov 18, 2011
  6. Junio C HamanoNov 18, 2011
  7. Jeff KingNov 18, 2011
  8. Shawn PearceNov 18, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.