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

Re: [PATCH 1/3] cache-tree: Create/update cache-tree on checkout

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 7, 2014, 16:58 UTC
Message-ID
<xmqq4mytf6mx.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1404619467.3109.38.camel@stross>
David Turner <dturner@twopensource.com> writes:
Show 14 quoted lines
>> I am not convinced that doing an equivalent of write-tree when you
>> switch branches is the right approach in the first place.  You will
>> eventually write it out as a tree, and having a relatively undamaged
>> cache-tree will help you when you do so, but spending the cycles
>> necessary to compute a fully populated cache-tree, only to let it
>> degrade over time until you are ready to write it out as a tree,
>> somehow sounds like asking for a duplicated work upfront.
>
> As I understand it, the cache-tree extension was originally designed to
> speed up writing the tree later.  However, as Karsten Blees's work (and
> my own tests) have shown, it also speeds up git status.  I use git
> status a lot while working, and I've talked to a few others who do the
> same.  So I think it's worth spending extra time when switching branches
> to have a good working experience within that branch.

You are reading the history of the subsystem correctly. Since b65982b6 (Optimize "diff-index --cached" using cache-tree, 2009-05-20), having an undamaged cache-tree does help with "git status" as well.

Show 6 quoted lines
> In the new version of the patchset (which I'll post shortly), I've added
> an option WRITE_TREE_REPAIR, which does all of the work to compute a new
> tree object, but only adds it to the cache-tree if it already exists
> on-disk.  This is a little wasteful for the reason that you note.  So if
> you would like, I could add a config option to skip it.  But I think it
> is a good default.
OK, sounds good.
Previous: David Turner
Message 13 of 13 in “cache-tree: Create/update cache-tree on checkout”
  1. 1/3 cache-tree: Create/update cache-tree on checkoutDavid Turner, Jul 1, 2014
  2. 2/3 test-dump-cache-tree: Improve output format and exit codeDavid Turner, Jul 1, 2014
  3. Eric SunshineJul 1, 2014
  4. 3/3 cache-tree: Write index with updated cache-tree after commitDavid Turner, Jul 1, 2014
  5. Torsten BögershausenJul 1, 2014
  6. Johannes SixtJul 1, 2014
  7. Torsten BögershausenJul 1, 2014
  8. David TurnerJul 1, 2014
  9. Junio C HamanoJul 1, 2014
  10. David TurnerJul 1, 2014
  11. Junio C HamanoJul 1, 2014
  12. David TurnerJul 6, 2014
  13. Junio C HamanoJul 7, 2014

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.