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

Re: Errors cloning large repo

From
Jakub Narebski <jnareb@gmail.com>
Date
Mar 12, 2007, 11:09 UTC
Message-ID
<200703121209.35052.jnareb@gmail.com>
In-Reply-To
<20070311020013.GD10343@spearce.org>
Shawn O. Pearce wrote:
Show 24 quoted lines
> Jakub Narebski <jnareb@gmail.com> wrote:
>> Shawn O. Pearce wrote:
>> 
>>> One thing that you could do is segment the repository into multiple
>>> packfiles yourself, and then clone using rsync or http, rather than
>>> using the native Git protocol.
>> 
>> By the way, it would be nice to have talked about fetch / clone
>> support for sending (and creating) _multiple_ pack files. Beside
>> the situation where we must use more than one packfile because
>> of size limits, it would also help clone as it could send existing
>> packs and pack only loose objects (trading perhaps some bandwidth
>> with CPU load on the server; think kernel.org).
> 
> I've thought about adding that type of protocol extension on
> more than one occasion, but have now convinced myself that it is
> completely unnecessary.  Well at least until a project has more
> than 2^32-1 objects anyway.
> 
> The reason is we can send any size packfile over the network; there
> is no index sent so there is no limit on how much data we transfer.
> We could easily just dump all existing packfiles as-is (just clip
> the header/footers and generate our own for the entire stream)
> and then send the loose objects on the end.

But what would happen if server supporting concatenated packfiles sends such stream to the old client? So I think some kind of protocol extension, or at least new request / new feature is needed for that.

Wouldn't it be better to pack loose objects into separate pack (and perhaps save it, if some threshold is crossed, and we have writing rights to repo), by the way?

Show 17 quoted lines
> The client could easily segment that into multiple packfiles
> locally using two rules:
> 
>   - if the last object was not a OBJ_COMMIT and this object is
>   an OBJ_COMMIT, start a new packfile with this object.
> 
>   - if adding this object to the current packfile exceeds my local
>   filesize threshold, start a new packfile.
> 
> The first rule works because we sort objects by type, and commits
> appear at the front of a packfile.  So if you see a non-commit
> followed by a commit, that's the packfile boundary that the
> server had.
> 
> The second rule is just common sense.  But I'm not sure the first
> rule is even worthwhile; the server's packfile boundaries have no
> real interest for the client.

Without first rule, wouldn't client end with strange packfile? Or would it have to rewrite a pack?

-- 
Jakub Narebski
Poland
Previous: Shawn O. PearceNext: Shawn O. Pearce
Message 10 of 14 in “Re: Errors cloning large repo”
  1. Anton TropashkoMar 10, 2007
  2. Shawn O. PearceMar 10, 2007
  3. Linus TorvaldsMar 10, 2007
  4. Shawn O. PearceMar 10, 2007
  5. Martin WaitzMar 10, 2007
  6. Linus TorvaldsMar 10, 2007
  7. Martin WaitzMar 11, 2007
  8. Jakub NarebskiMar 10, 2007
  9. Shawn O. PearceMar 11, 2007
  10. Jakub NarebskiMar 12, 2007
  11. Shawn O. PearceMar 12, 2007
  12. Jakub NarebskiMar 17, 2007
  13. Linus TorvaldsMar 10, 2007
  14. Linus TorvaldsMar 10, 2007

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.