> I'm seriously considering starting ack 3.
I'm thinking that ack3 should be a new repo, since the current one is called "ack2", but if we do that then any references to existing issues, such as in t/issue*.t, will be broken.
I think that the infrastructure that we have is pretty brittle, especially with all the hoohah we put in to allow plugins. Well, nobody uses plugins, and nobody wants to write them, so they need to get yanked.
$str = "(?:\\b|(?!\\w))$str";
$str = "$str(?:\\b|(?<!\\w))";
As well as the proposed fix I submitted a merge request to document and test the current behaviour of -w, which you can find in trunk.
However I hope you agree with me that this documentation of the odd "words mode" is describing a peculiar behaviour that few would want to use,
and the test case added is testing for the presence of a bug rather than serving to describe a useful and correct set of semantics.
Still, it does ensure that when the bug is fixed the documentation and test cases will be updated with it.
This recent documentation change must be the reason why my merge request no longer merges -- I will see if I can rebase it.
On Feb 27, 2017, at 10:01 AM, Edward Avis <e...@membled.com> wrote:This recent documentation change must be the reason why my merge request no longer merges -- I will see if I can rebase it.
On Feb 27, 2017, at 10:20 AM, Edward Avis <e...@membled.com> wrote:% ack -w 'fo{2}'
warning: although -w is given, matches found will not necessarily be whole words, since the regexp does not end in a word character
On Feb 27, 2017, at 10:20 AM, Edward Avis <e...@membled.com> wrote:% ack -w 'fo{2}'
warning: although -w is given, matches found will not necessarily be whole words, since the regexp does not end in a word characterInteresting. Thoughts from others?
Bill R., you are right that the test coverage could be more complete. I will see if I can expand it.
On Mar 6, 2017, at 3:45 AM, Edward Avis <e...@membled.com> wrote:If Andy L. agrees that following grep is the way forward, then I will update my merge request to do that. It can then be merged in once ack 3 development opens.
On Mar 6, 2017, at 9:01 AM, Edward Avis <e...@membled.com> wrote:I just wondered if you agree with the general principle of "do what grep does" being applied to the -w flag too. If so, then it takes care of a great deal of the specifics of how -w works.
On Mar 6, 2017, at 9:48 AM, Edward Avis <e...@membled.com> wrote:Thanks. At this point I am concerned with having a working -w implementation for my own use and that of the users at my site. I will probably move to "do what grep does" in order to align with the planned change in upstream.
In general, yes, we should do what grep does.
On Mar 6, 2017, at 11:22 AM, Edward Avis <e...@membled.com> wrote:While I agree that we could start to define different behaviours for 'ack -w :::' which we may consider make more sense than grep, I think the bar has to be set quite high for that. This is partly for philosophical reasons (ack tries to follow what grep does), but mostly for practical ones. If you decide to follow grep then any argument about semantics can be settled instantly. If you decide to do something which is almost the same but a tiny bit better, you end up with long mailing list threads going over what ought to happen. That is why I suggest copying grep, not because I have a strong opinion about what -:::- should match, but to simplify life and allow us to get on with implementation.
So what behavior exactly are you proposing?
On Mar 6, 2017, at 11:30 AM, Edward Avis <e...@membled.com> wrote:I am proposing to make the -w flag follow GNU grep, which documents its behaviour as
>
> that was not Ed
Sorry. Thanks for clarifying. I’ve been lost in Real Work this morning.
> (a) he proposed Warning as interim mitigation only
> (b) i proposed Error instead of warning (for mitigation)
In 2.x, correct?
I’m OK with pursuing these ideas, AFTER we know what exactly we’re doing with ack 3.
> (c) i also suggested that since ::: can't be a true 'word' it could be a real error
So what then is a “true word”? To me these are all legit to call “ack3 -w” on.
foo
foo(bar.*)
(set|get)_user_(profile|name|records?)
(foo)\1
\w+
\d+
(_+)\w+\1 # __IS_DEFINED__, _SOME_MARKER_, etc
It seems to me that trying to define what a “word” is such that we can warn if you call ack3 -w on a non-word is a losing proposition. But I’m open to ideas.