From: Duy Nguyen Date: Tue, 06 May 2014 00:26:26 GMT Subject: Re: Watchman support for git Message-ID: In-Reply-To: On Sat, May 3, 2014 at 7:52 AM, Duy Nguyen wrote: > wt_status_collect_changes_index() depends on how damaged cache-tree is > (in this case, totally scraped). watchman does not help this either. > We need to try to "heal" cache-tree as much as possible to reduce the > number. On the topic of cache-tree, I notice that unpack_trees() will call discard_index() in the end (or even discard_index() on a merge failure). That destroys cache-tree. unpack_trees() is the core of branch switching, or reset/merge, which I consider frequent operations. Cache-tree destruction is bad for "git diff --cached", "git commit" and maybe more. This discard_index() code was added recently in e28f764 (unpack-trees: plug a memory leak - 2013-08-13). As a workaround, perhaps we only do so when the sequencer is running. -- Duy