beyondgrep / ack2

**ack 2 is no longer being maintained. ack 3 is the latest version.**
https://github.com/beyondgrep/ack3/
Other
1.48k stars 138 forks source link

Document and test current semantics of -w. #585

Closed epa closed 7 years ago

epa commented 8 years ago

As discussed in #558, this patch does not change any behaviour, but more clearly documents the current semantics of the -w flag and adds some tests for it.

If you can merge this, I will then send a separate pull request suggesting to change the -w semantics to something more useful, and updating the tests and documentation accordingly.

epa commented 8 years ago

Hooray, the tests pass. Let me know if you need anything else to merge this.

epa commented 7 years ago

Could I ask you to have another look at this merge request please? It is just tests and documentation, so should be safe to merge.

petdance commented 7 years ago

Merged. Thank you. #6ceb946

epa commented 7 years ago

Thanks for merging this. Would you like to discuss the possible change to the -w semantics to make them more like those used by grep? (I asked on the mailing list about the change but as I recall there was no response.)

petdance commented 7 years ago

If we were to change -w's semantics it would need to be in ack 3.0. Fortunately, I'm considering ack 3.0. You may want to sign up for the ack-dev mailing list.

petdance commented 7 years ago

See also 6ceb946

epa commented 7 years ago

Would you consider a -W flag that matches whole words without the subtleties of checking the first and last characters of the regexp? For me personally the current -w is something of a weakness in ack if it is to be a replacement for grep.

petdance commented 7 years ago

Join the ack-dev list and when I start talking about the plans for ack 3.0, let's discuss there.

epa commented 7 years ago

I meant, as a way to incorporate the bug fix (as I see it) in a stable release. The semantics of -w were changed with af21f7ddd in 2014, which did not require a new major version for the change. If you don't want to either change -w or add -W to ack2 then I will continue to carry it as a local patch. That would seem at odds with the guiding principle of "what would grep do". (I'll join ack-dev too)