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

Re: Notes on supporting Git operations in/on partial Working Directories

From
Shawn Pearce <spearce@spearce.org>
Date
Sep 14, 2006, 19:21 UTC
Message-ID
<20060914192119.GC10556@spearce.org>
In-Reply-To
<4509A7EC.9090805@gmail.com>
A Large Angry SCM <gitzilla@gmail.com> wrote:
Show 5 quoted lines
> 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.
Why not just load a partial index?

If we only want "a/b/c/d" subtree then only load that into the index. At git-write-tree time return the new root tree by loading the tree of the current `HEAD` commit and walking down to a/b/c/d, updating that with the tree from the index, then walking back updating each node you recursed down through. Finally output the new root tree.

The advantage is that if you have a subtree checked out you aren't working with the entire massive index.

But how does this let the user checkout and work on the 10 top
level directories at once and perform an atomic commit to all
of them, but not checkout the other 100+ top level directories?
As I recall this was desired in the Mozilla project for example.
 
> [*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.

Please, no. On a project with a large number of directories operations like git-write-tree would take a longer time to scan the index and generate the new trees. I unfortunately work on such projects as its common for Java applications to be very deeply nested and large projects have a *lot* of directories.

-- 
Shawn.
Previous: A Large Angry SCMNext: A Large Angry SCM
Message 2 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.