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

Re: maintenance of cache-tree data

From
Junio C Hamano <junkio@cox.net>
Date
Apr 25, 2006, 23:05 UTC
Message-ID
<7vy7xttfvv.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<7vk69e61s4.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> writes:
Show 5 quoted lines
> Well, I was blind ;-).  As long as the whole-file SHA1 matches,
> read_cache() does not care if we have extra data after the
> series of active_nr cache entry data in the index file.
>
> I'm working on a patch now.
So I did.

There is one bad thing; so far "write-tree" was a read-only consumer of the index file, but now it primes the cache-tree structure and needs to update the index. But that is minor.

While I was at it, I made this "stuffing extra cruft in the index" slightly more generic than I needed it for this particular application. What I see this _might_ be useful for are:

 - We would want to store which commit of a subproject a
   particular subdirectory came from.  This was one missing
   piece from the "bind commit" proposal that wasn't implemented
   in the jc/bind branch.
 - We might want to record "at this path there is a directory,
   albeit empty"; this cannot be expressed with an usual index
   entry.
   We might be able to use cache-tree for that, but I think this
   is something different at the logical level.  While
   cache-tree is to be fully populated (by write-tree and
   perhaps read-tree later) and invalidated partially when
   update-index and friends smudge part of the tree, this is not
   something we would want to even invalidate (IOW, it should
   always be up-to-date), so they serve different purposes.

I still haven't looked at the read-tree yet, but as I outlined in a previous message, its intra-index merge could take advantage of cache-tree. "diff-index", especially "--cached" kind, also could use it to skip unchanged subtrees altogether.

Previous: Junio C Hamano
Message 8 of 8 in “Invalidate cache-tree entries for touched paths in git-apply.”
  1. 4/4 Invalidate cache-tree entries for touched paths in git-apply.Junio C Hamano, Apr 23, 2006
  2. Junio C HamanoApr 24, 2006
  3. Junio C HamanoApr 24, 2006
  4. 5/4 Minimum fixups to cache-treeJunio C Hamano, Apr 24, 2006
  5. 50% speed-up of "git-apply && git-write-tree" sequence.Junio C Hamano, Apr 24, 2006
  6. maintenance of cache-tree dataJunio C Hamano, Apr 24, 2006
  7. Junio C HamanoApr 24, 2006
  8. Junio C HamanoApr 25, 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.