Performance testing of ignore changes?
John Whitley
whitley at bangpath.org
Mon Jan 11 21:10:34 GMT 2010
John Arbash Meinel <john <at> arbash-meinel.com> writes:
> There is also the problem that there is a global ignore file
> (~/.bazaar/ignore) and when do those ignores take place versus local
> ignores (possibly just all take precedence...)
This is done per the existing implementation as a merge of the global ignore
file with the local ignores. Having globals take take precedence would incur a
performance hit and is not desirable in the presence of ignore exceptions, since
the following scenario then breaks:
--- global ignore
# user: "I just generate these anyways, right?"
*.html
--- local ignore
# ignore generated files:
*.html
# except these manually-mantained ones:
special.html
---
> Well, we already split at 99 sub-groups, because the regex engine
> requires it. Also, we use separate regexes for "*.ext" rules versus
> rules with a '/' versus rules without. So it is actually 3 or 3x2=6
> regexes at a minimum. Though still bound versus N regexes.
Note that my implementation (renamed, now at lp:~whitley/bzr/ignore-exception)
could at most triple this cost, as the new ExceptionGlobster has three
sub-Globsters, one for each level: regular ignores, '!' patterns, and '!!'
patterns. I used Globster with an eye towards retaining the performance-focused
partitioning of patterns already implemented there.
> I generally agree here. Though we should note that he is potentially
> adding a third "exclude-from-excluded-ignores".
Done, in the branch mentioned above.
> He has a reasonable use case for it, though I don't know if
> in practice it is worth the effort.
The code change vs. the plain exception case is minor, and _I'll_ use it, even
if no one else does... Ignores are a valuable part of comprehending working
tree state, and I really want them to work properly in scenarios with a broad
top-level ignore (e.g. a '*') pattern.
> You *could* just write your excluded form in a regex that doesn't match
> the files you want to keep ignored. Though that is often horrible to do.
I'd already thought of that, I'm fully capable of it, and life is too short for
that. It would annoy me enough that I'd write a tool to manage it, thus the
existence of my branch. ;-)
-- John
More information about the bazaar
mailing list