Re: inotify to minimize stat() calls
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Mar 8, 2013, 10:53 UTC
- Message-ID
- <CACsJy8DZm153Tu_3GTOnxF8bFrYPh7_DP6Rn6rr3n6tfuVuv2Q@mail.gmail.com>
- In-Reply-To
- <7v7glijoiy.fsf@alter.siamese.dyndns.org>
On Fri, Mar 8, 2013 at 3:15 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 20 quoted lines
>> The possible options are: >> + >> - - 'no' - Show no untracked files >> + - 'no' - Show no untracked files (this is fastest) > > There is a trade-off around the use of -uno between safety and > performance. The default is not to use -uno so that you will not > forget to add a file you newly created (i.e safety). You would pay > for the safety with the cost to find such untracked files (i.e. > performance). > > I suspect that the documentation was written with the assumption > that at least for the people who are reading this part of the > documentation, the trade-off is obvious. In order to find more > information, you naturally need to spend more cycles. > > If the trade-off is not so obvious, however, I do not object at all > to describing it. But if we are to do so, I do object to mentioning > only one side of the trade-off. People who choose "fastest" needs > to be made very aware that they are disabling "safety".
On the topic of trading off, I was thinking about new -uauto as default that is like -uall if it takes less than a certan amount of time (e.g. 0.5 seconds), if it exceeds that limit, the operation is aborted (i.e. it turns to -uno). The safety net is still there, "git status" advices to use -u to show full information.
Or a less intrusive approach: measure the time and advice the user to (read doc and) use -uno.
But it's probably worth waiting for the first cut of inotify support from Ram. It's better with inotify anyway.
-- Duy