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

Re: Sparse clones (Was: Re: [PATCH 1/2] upload-pack: support subtree packing)

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Jul 28, 2010, 07:11 UTC
Message-ID
<AANLkTikcV7BdJ_07yLei9_H_kR2GEOi4707J1gGhS-Mr@mail.gmail.com>
In-Reply-To
<AANLkTi=WjBHYngSDgowD2+0FT3hG+oDYefp2aUostV3U@mail.gmail.com>
On Wed, Jul 28, 2010 at 1:58 PM, Avery Pennarun <apenwarr@gmail.com> wrote:
Show 25 quoted lines
> On Wed, Jul 28, 2010 at 1:06 PM, Nguyen Thai Ngoc Duy <pclouds@gmail.com> wrote:
>> 2010/7/28 Avery Pennarun <apenwarr@gmail.com>:
>>> 2010/7/27 Elijah Newren <newren@gmail.com>:
>>>> 0) Sparse clones have "all" commit objects, but not all trees/blobs.
>>>>
>>>> Note that "all" only means all that are reachable from the refs being
>>>> downloaded, of course.  I think this is widely agreed upon and has
>>>> been suggested many times on this list.
>>>
>>> I think downloading all commit objects would require very low
>>> bandwidth and storage space, so it should be harmless.
>> >
>> > In fact, I have a pretty strong impression that also downloading
>> > all *tree* objects would be fine too.
>>
>> Here you go. A pack with only commits and trees of git.git#master is
>> 15M. With blobs, it is 28M. Git is not a typical repo with large blobs
>> though.
>
> Hmm, that's very interesting - more than half the repo is just tree
> and commit objects?  Maybe that's not so shocking after all, given the
> tendency in the git project to use long commit messages and relatively
> short patches.
>
> Was your pack carefully ordered for best deltification?

I did not do any optimization. It's pack-objects' defaults. I only filtered blobs out and that's what fetch-pack would receive.

>
> Knowing how much of that is commits vs. trees would also be very interesting.
Commits only takes 7.8 MB. Well.. all those commit messages..
Show 5 quoted lines
> But if so, only saving half the space is kind of disappointing.  If
> you have a script around for generating this, it would be very
> interesting to compare the results with, say, the Linux kernel repo
> (especially since it seems to be the #1 example of "submodules people
> don't want to check out because they're so bloody huge").

I modified pack-objects.c, show_object() to certain objects. Actually I started with git-fetch-pack, but you can do

git rev-parse master | git pack-objects --revs --delta-base-offset pack
Then verify what's in the pack with
git verify-pack -v pack-*.idx
-- 
Duy
Previous: Sverre RabbelierNext: Elijah Newren
Message 9 of 16 in “Sparse clones (Was: Re: [PATCH 1/2] upload-pack: support subtree packing)”
  1. Elijah NewrenJul 28, 2010
  2. Avery PennarunJul 28, 2010
  3. Nguyen Thai Ngoc DuyJul 28, 2010
  4. Nguyen Thai Ngoc DuyJul 28, 2010
  5. Avery PennarunJul 28, 2010
  6. Sverre RabbelierJul 28, 2010
  7. Nguyen Thai Ngoc DuyJul 28, 2010
  8. Sverre RabbelierJul 28, 2010
  9. Nguyen Thai Ngoc DuyJul 28, 2010
  10. Elijah NewrenJul 28, 2010
  11. Elijah NewrenJul 31, 2010
  12. Nguyen Thai Ngoc DuyJul 28, 2010
  13. Elijah NewrenJul 28, 2010
  14. Nguyen Thai Ngoc DuyJul 29, 2010
  15. Enrico WeigeltAug 13, 2010
  16. Truncating history (Re: Sparse clones)Jonathan Nieder, Aug 13, 2010

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.