Re: Watchman support for git
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- May 6, 2014, 00:26 UTC
- Message-ID
- <CACsJy8DWK9ysCJobh4oQZe2hxdTaE=n7hH=Nm6bfWzx+yJ=KZg@mail.gmail.com>
- In-Reply-To
- <CACsJy8C72QQZd4v+p4bkFFKHnN2Uj1zD-BELwGtYB7sx1P6q6g@mail.gmail.com>
On Sat, May 3, 2014 at 7:52 AM, Duy Nguyen <pclouds@gmail.com> 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