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

Re: restriction of pulls

From
RDRogan Dawes <lists@dawes.za.net>
Date
Feb 9, 2007, 15:32 UTC
Message-ID
<45CC941E.9030808@dawes.za.net>
In-Reply-To
<Pine.LNX.4.63.0702091554160.22628@wbgn013.biozentrum.uni-wuerzburg.de>
Johannes Schindelin wrote:
Show 13 quoted lines
> Hi,
> 
> On Fri, 9 Feb 2007, Christoph Duelli wrote:
> 
>> Is it possible to restrict a chechout, clone or a later pull to some 
>> subdirectory of a repository?
> 
> No. In git, a revision really is a revision, and not a group of file 
> revisions.
> 
> Ciao,
> Dscho
> 

I thought about how this might be implemented, although I'm not entirely sure how efficient this will be.

One obstacle to implementing partial checkouts is that one does not know which objects have changed or been deleted. One way of addressing this is to keep a record of the hashes of all the objects that were NOT checked out. (If one does not check out part of a directory, simply store the hash of the top level, and you do not need to store the child hashes.) This record would be a kind of "negative index".

When deciding what to check in, or which files are modified, one would check the "negative index" first to see if an entry exists. If not, only then would you check the filesystem to see if modification times have changed. With the "negative index", and the files in the file system, one would be able to construct new commits, without any problem.

It would also require an updated transfer protocol, which would allow the client to specify a tag/commit, then walk the tree that it points to to find the portion that the client is looking for, then pull only those objects (and possibly their history). This is likely to be VERY inefficient in terms of round trips, at least initially.

This might be able to benefit from the shallow checkout support that was recently implemented.

Comments?
Rogan
Previous: Johannes SchindelinNext: Andy Parkins
Message 4 of 13 in “restriction of pulls”
  1. Christoph DuelliFeb 9, 2007
  2. Jakub NarebskiFeb 9, 2007
  3. Johannes SchindelinFeb 9, 2007
  4. Rogan DawesFeb 9, 2007
  5. Andy ParkinsFeb 9, 2007
  6. Rogan DawesFeb 9, 2007
  7. Andy ParkinsFeb 9, 2007
  8. Rogan DawesFeb 9, 2007
  9. Andy ParkinsFeb 10, 2007
  10. Johannes SchindelinFeb 10, 2007
  11. Rogan DawesFeb 12, 2007
  12. Johannes SchindelinFeb 12, 2007
  13. Rogan DawesFeb 12, 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.