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, 03:36 UTC
Message-ID
<AANLkTikvhi-Bm-eV9ZfjoZdugRpiCwg8n-TQ4oOVvC=G@mail.gmail.com>
In-Reply-To
<AANLkTikJhSVJw2hXkp0j6XA+k-J-AtSYzKWumjnqqsgz@mail.gmail.com>
2010/7/28 Elijah Newren <newren@gmail.com>:
Show 7 quoted lines
> 1) A user controls sparseness by passing rev-list arguments to clone.
>
> This allows a user to control sparseness both in terms of span of
> content (files/directories) and depth of history.  It can also be used
> to limit to a subset of refs (cloning just one or two branches instead
> of all branches and tags).  For example,
>  $ git clone ssh://repo.git dst -- Documentation/
Does pathspec is supported to in addition to prefix?
Show 12 quoted lines
>  $ git clone ssh://repo.git dst master~6..master
>  $ git clone ssh://repo.git dst -3
> (Note that the destination argument becomes mandatory for those doing
> a sparse clone in order to disambiguate it from rev-list options.)
>
> This method also means users don't need much training to learn how to
> use sparse clones -- they just use syntax they've already learned with
> log, and clone will pass this info on to upload-pack.
>
> There is a slight question as to whether users should have to specify
> "--all HEAD" with all sparse clones or whether it should be assumed
> when no other refs are listed.

So you basically kill off shallow clone too, with "master~6..master". I wonder what happens if user does "git clone ... master~6..master~3"?

Show 15 quoted lines
> 4) All revision-walking operations automatically use these limiting args.
>
> This should be a simple code change, and would enable rev-list, log,
> etc. to avoid missing blobs/trees and thus enable them to work with
> sparse clones.  fsck would take a bit more work, since it doesn't use
> the setup_revisions() and revision.h walking machinery, but shouldn't
> be too bad (I hope).
>
> There are also performance ramifications: There should be no
> measurable performance overhead for non-sparse clones (something that
> might be a problem with a different implementation that did
> does-this-exist check each time it references a blob).  It should also
> be a significant performance boost for those using it, as operations
> will only need to deal with the subset of the repository they specify
> (faster downloads, stats, logs, etc.)

Revision walking is not the only gate to access objects. Others like diff machinery needs also be taught about rev-list limits.

Show 9 quoted lines
> 5) "Densifying" a sparse clone can be done
>
> One can fetch a new pack and replace the limiting rev-list args with
> the new choice.  The sparse checkout information needs to be updated
> too.
>
> (So users probably would want to densify a sparse clone with "pull"
> rather than "fetch", as manually updating sparse checkouts may be a
> bit of a hassle.)

What information would you send to the server to request new pack in sparse clone? Currently we send all commit tips. rev-list has a notion to subtract commit trees. I don't know if it can "add" or "subtract" tree prefix though.

-- 
Duy
Previous: Elijah NewrenNext: Elijah Newren
Message 12 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.