Re: Watchman support for git
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- May 13, 2014, 22:54 UTC
- Message-ID
- <CACsJy8CVK1codmuSvUyeVYo1d-nQ6thoV8pn1WN_8D8doYXu5g@mail.gmail.com>
- In-Reply-To
- <1400020707.14179.13.camel@stross>
On Wed, May 14, 2014 at 5:38 AM, David Turner <dturner@twopensource.com> wrote:
Show 18 quoted lines
> On Mon, 2014-05-12 at 17:45 +0700, Duy Nguyen wrote: >> This is your quote from above, moved down a bit: >> >> > update_fs_cache should only have to update based on what it has learned >> > from watchman. So if no .gitignore has been changed, it should not have >> > to do very much work. >> > >> > I could take the fe_excluded check and move it above the >> > last_exclude_matching check in fs_cache_is_excluded; it causes t7300 to >> > fail when run under watchman but presumably that's fixable >> >> So you exclude files early and make the real read_directory() pass do >> pretty much nothing. This is probably not a good idea. Assume that I >> touch $TOP/.gitignore then do something other than "git status" (or >> "git add") then I have to pay read_directory() cost. > > I'm not sure I understand this. read_directory does something: it checks > the fs_cache (instead of the filesystem) for untracked files.
A lot of commands do read_cache() that that eventually calls update_fs_cache, which does part of read_directory's work (the fe_excluded thing). But not many of those commands actually call read_directory(). It'd better if there's a way to mark that "this .gitignore is changed", but delay the actual exclude processsing until we are sure read_directory() will be used.
-- Duy