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

RFC: Sparse checkout improvements (was: Re: question (possibly) on git subtree/submodules)

From
Marc Branchaud <marcnarc@xiplink.com>
Date
Jul 27, 2010, 14:24 UTC
Message-ID
<4C4EEC0D.2070105@xiplink.com>
In-Reply-To
<m3bp9tks6e.fsf@localhost.localdomain>
On 10-07-27 08:48 AM, Jakub Narebski wrote:
Show 14 quoted lines
> Alex <ajb44.geo@yahoo.com> writes:
> 
>> Chris Packham <judge.packham <at> gmail.com> writes:
>>
>>> The short answer is no. Nothing git has currently will let you clone a
>>> subset of files. 
>>
>> Isn't that what 'sparse checkout' does?
>> (http://www.kernel.org/pub/software/scm/git/docs/git-read-tree.html#_sparse_checkout)
> 
> No, 'sparse checkout' is only about checkout, i.e. the working area.
> You still have all objects in repository, only part of tree (part of
> project / repository) is not checked out, not present on disk as
> files.
There's no such thing as a "sparse fetch" but you can do something like
	git clone -n git://there/foo.git
	cd foo
then
	git checkout origin/<branch> -- <paths...>
or
	git config core.sparseCheckout true
	[ Add paths to .git/info/sparse-checkout ]
	git checkout <branch>

but it's fairly inconvenient for day-to-day work. Also, putting a .git/info/sparse-checkout file in a public repo seems of limited use.

So IMHO the current sparse-checkout feature is pretty bare-bones and could use some meat. Here's some thoughts:

* What's missing is a way to define named collections of paths
("sparse-sets?") in .git/info/sparse-checkout, so that you can conveniently
checkout a particular subset of the working directory.  It would also be nice
to switch between different sparse-sets.
* It would also be good to have a way for a repo to define a default
sparse-set, so that a clone would only checkout that default.
* I also think that core.sparseCheckout should be true by default, and git
should impose no sparseness if .git/info/sparse-checkout is missing or empty.
Comments?
		M.
Previous: Jakub NarebskiNext: skillzero@gmail.com
Message 7 of 9 in “question (possibly) on git subtree/submodules”
  1. Maurizio VitaleJul 23, 2010
  2. Chris PackhamJul 23, 2010
  3. Jonathan NiederJul 23, 2010
  4. Chris PackhamJul 23, 2010
  5. AlexJul 27, 2010
  6. Jakub NarebskiJul 27, 2010
  7. RFC: Sparse checkout improvements (was: Re: question (possibly) on git subtree/submodules)Marc Branchaud, Jul 27, 2010
  8. skillzero@gmail.comJul 27, 2010
  9. Marc BranchaudJul 28, 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.