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

Notes on supporting Git operations in/on partial Working Directories

From
A Large Angry SCM <gitzilla@gmail.com>
Date
Sep 14, 2006, 19:05 UTC
Message-ID
<4509A7EC.9090805@gmail.com>

Notes on supporting Git operations in/on partial Working Directories ====================================================================

Motivation ---------- Be able to checkout only part of a tree, do some work, and commit the changes. Support for partial working directories is also (almost) a requirement for supporting partial repositories.

Expectations ------------ All Git commands that currently work with the index or the working directory will work with indexes or working directories that are partial checkouts.

Leading directories common to all objects of a partial checkout are not present in the working directory.

The contents of a partial working directory can be determined on an path by path basis; entire directories are not required.

Implementation Sketch --------------------- The minimum required changes[*1*][*2*][*3*] to the index file to support partial checkouts are:

1) the addition of WD_Prefix string to hold the common path prefix of
all objects in the working directory. For a full checkout, the WD_Prefix
string would be empty.
2) A (new) flag for each entry in the index indicating whether or not
the object is in the partial checkout.

The contents of the index file still reflect the full tree but flag each object (file or symlink) separately as part of the checkout or not. The WD_Prefix string is so that a partial checkout consisting of only objects somewhere in the a/b/c/d/ tree can be found in the working directory without the a/b/c/d/ prefix to the path of the object.

All the Git commands that use the index file will need to be changed to support this but the transfer protocols do not need to change.

Notes
-----
[*1*] As long as the index file structure is being changed, it may be
worth while also including the ideas in:
	http://www.gelato.unsw.edu.au/archives/git/0601/15471.html
	http://www.gelato.unsw.edu.au/archives/git/0601/15483.html
	http://www.gelato.unsw.edu.au/archives/git/0601/15484.html
Except for the "bind" parts since I still think that is a bad idea.

[*2*] The index "TREE" (cache-tree) extension should also become a required part of the index.

[*3*] Possibly split the index up by directory and store the parts in the working directory. An index "distributed" in this way would have a "natural" cache-tree built in and (finally) be able support empty directories.

Next: Shawn Pearce
Message 1 of 13 in “Notes on supporting Git operations in/on partial Working Directories”
  1. A Large Angry SCMSep 14, 2006
  2. Shawn PearceSep 14, 2006
  3. A Large Angry SCMSep 14, 2006
  4. Junio C HamanoSep 14, 2006
  5. A Large Angry SCMSep 14, 2006
  6. Junio C HamanoSep 15, 2006
  7. A Large Angry SCMSep 15, 2006
  8. Junio C HamanoSep 17, 2006
  9. A Large Angry SCMSep 17, 2006
  10. Jakub NarebskiSep 17, 2006
  11. A Large Angry SCMSep 17, 2006
  12. Jakub NarebskiSep 17, 2006
  13. A Large Angry SCMSep 17, 2006

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.