New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to disable certain selector types #135
Comments
What would the benefit of this be? Disabling all firstlinematch checks, and thus saving us the speed hit of opening the file and reading the first line? Is that the optimization you're after? Maybe ack2 could be smart enough to say "Hey, there are no firstlinematch checks to be done, so I'm smart enough to not bother reading the file at all." Or maybe it's already that smart? |
@petdance That is the optimization I'm after, and ack2 won't check the first line of the file unless a firstlinematch is used (although it may be opening the file once per filter, but that should be easy enough to fix). |
If we get the optimization implicitly, then what's the benefit of explicitly specifying it? |
Because there are a bunch of firstlinematch selectors in the default ackrc now. Meaning that every file that doesn't match the extensions for a |
I'm thinking that removing those offending lines from one's ackrc would be the way to go, rather than having a rule to ignore a given type. |
Right, but you'd have to tell ack to ignore its defaults, and import the default ackrc into your own .ackrc file, and make sure you keep it up to date. Maybe it's too specific for a feature, but I thought I'd at least bring up the idea for discussion. |
Oh yeah, I forgot we don't have the global ackrc any more. :-) |
What if, as a user, I didn't care about firstlinematch selectors, but I didn't want to redefine the default selector rules?
--remove-selector-type=firstlinematch
could be handy. Or not. Just a thought.The text was updated successfully, but these errors were encountered: