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

Re: [PATCH] Teach receive-pack how to keep pack files when unpacklooseobjects = 0.

From
Junio C Hamano <junkio@cox.net>
Date
Oct 30, 2006, 23:23 UTC
Message-ID
<7vlkmxtmln.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20061030223615.GH5775@spearce.org>
Shawn Pearce <spearce@spearce.org> writes:
> Since keeping a pushed pack or exploding it into loose objects should
> be a local repository decision this teaches receive-pack to decide
> if it should call unpack-objects or index-pack --stdin --fix-thin
> based on the setting of receive.unpackLooseObjects.

One thing you can cheaply do is to tell the number of new commits that is coming to receive-pack from send-pack when it sends the old..new pairs before it sends the packfile payload. It would be just a single internal rev-list call inside send-pack, which is reasonably cheap.

If the receiving end knows how to process that new information (invent a "send-count" protocol extension and send it just like we already send "report-status" request), send one extra packet after flushing the list of old..new from send-pack to receive-pack, to tell what the number of commits are, and make a matching change in receive-pack.

Then, instead of receive.unpackLooseObjects being a boolean, you can have it as a ceiling to decide if you have more than 100 commits you would keep it packed and otherwise you would explode. That would be very specific to the projects' size (width of the tree) and style (huge commits vs lots of small changes).

Previous: Shawn PearceNext: Nicolas Pitre
Message 4 of 9 in “Teach receive-pack how to keep pack files when unpacklooseobjects = 0.”
  1. Teach receive-pack how to keep pack files when unpacklooseobjects = 0.Shawn Pearce, Oct 30, 2006
  2. Junio C HamanoOct 30, 2006
  3. Shawn PearceOct 31, 2006
  4. Junio C HamanoOct 30, 2006
  5. Nicolas PitreOct 31, 2006
  6. Junio C HamanoOct 31, 2006
  7. Shawn PearceOct 31, 2006
  8. Junio C HamanoOct 31, 2006
  9. Shawn PearceOct 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.