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

Re: [PATCH 2/2] Teach receive-pack how to keep pack files based on object count.

From
Nicolas Pitre <nico@cam.org>
Date
Oct 31, 2006, 22:06 UTC
Message-ID
<Pine.LNX.4.64.0610311659310.11384@xanadu.home>
In-Reply-To
<20061031212942.GA24184@spearce.org>
On Tue, 31 Oct 2006, Shawn Pearce wrote:
Show 9 quoted lines
> Nicolas Pitre <nico@cam.org> wrote:
> > I used "pack" <tab> <sha1> so it is easy to pick out of the list of refs 
> > that usually comes over the stream in the fetch case (if I understood 
> > that part right).
> 
> I thought about using a pipe too, but in the case of receive-pack
> it looked like index-pack was sending something back to the push
> end of the connection.  I didn't dig into the code enough to see
> what that was and how to do the same in receive-pack itself.
Well, I think it goes like this:

unpack-objects (and now index-pack --stdin) reads from stdin in 4kb chunks. When the pack has been entirely parsed, it is possible that the 4kb chunk contains data from the stream past the actual pack data which is why the remaining of the buffer is flushed out to stdout for the next tool in the chain to pick up.

So if you use a pipe with index-pack to retrieve the pack name, you also must consume all extra data from it and pass it on as well.

Previous: Shawn PearceNext: Junio C Hamano
Message 6 of 7 in “Teach receive-pack how to keep pack files based on object count.”
  1. 2/2 Teach receive-pack how to keep pack files based on object count.Shawn Pearce, Oct 31, 2006
  2. Nicolas PitreOct 31, 2006
  3. Shawn PearceOct 31, 2006
  4. Nicolas PitreOct 31, 2006
  5. Shawn PearceOct 31, 2006
  6. Nicolas PitreOct 31, 2006
  7. Junio C HamanoOct 31, 2006

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.