Re: inotify to minimize stat() calls
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Feb 11, 2013, 03:03 UTC
- Message-ID
- <CACsJy8Aw1GpKXGwjMdzjXBxAMrC-q6HDSyi2u6EoXCYDV8fJ4Q@mail.gmail.com>
- In-Reply-To
- <CALkWK0kLieAfPihX3j=BzD+ndo-g-2210Za2xN=HbHcRVwgMtA@mail.gmail.com>
On Sun, Feb 10, 2013 at 11:45 PM, Ramkumar Ramachandra <artagnon@gmail.com> wrote:
Show 8 quoted lines
> So you're skipping the rest of refresh_cache_ent(), which contains our > lstat() and returning immediately. Instead of marking paths with the > "assume unchanged" bit, as core.ignoreStat does, you're directly > attacking the function that refreshes the index and bypassing the > lstat() call. How are they different? read-cache.c:1030 checks > ce->flags & CE_VALID (which is set in read-cache.c:88 if > assume_unchanged) and bypasses the lstat() call anyway. So why didn't > you just set core.ignoreStat for your test?
It just did not occur to me that core.ignoreStat does the same.
Show 8 quoted lines
> Ah, read_directory(), from the .gitignore/ exclude angle. Yes, > read_directory() seems to be the main culprit there, from my reading > of Documentation/technical/api-directory-listing.txt. > > So, what did you do? You short-circuited the function into never > executing read_directory_recursive(), so the opendir() and readdir() > are gone. I'm confused about what this means: will new directories > fail to appear as "untracked" now?
No, read_directory returns the list of untracked/ignored files. Returning empty lists means no untracked nor ignored files.
-- Duy