Re: git grep -P is multiline for negative lookahead/behind

2016-08-04 Thread Junio C Hamano
On Thu, Aug 4, 2016 at 11:54 AM, Michael Giuffrida wrote: > On Mon, Aug 1, 2016 at 2:35 PM, Junio C Hamano wrote: >> I do not think "git grep" was designed to do multi-line anything, >> with or without lookahead. If you imagine that the implementation

Re: git grep -P is multiline for negative lookahead/behind

2016-08-04 Thread Michael Giuffrida
On Mon, Aug 1, 2016 at 2:35 PM, Junio C Hamano wrote: > Michael Giuffrida writes: > >> Is this expected behavior, and if so, why/where is this documented? > > I do not think "git grep" was designed to do multi-line anything, > with or without lookahead.

Re: git grep -P is multiline for negative lookahead/behind

2016-08-01 Thread Junio C Hamano
Michael Giuffrida writes: > Is this expected behavior, and if so, why/where is this documented? I do not think "git grep" was designed to do multi-line anything, with or without lookahead. If you imagine that the implementation attempts its matches line-by-line, does

git grep -P is multiline for negative lookahead/behind

2016-08-01 Thread Michael Giuffrida
Negative lookahead/lookbehind with `git grep -P` considers the surrounding lines of an otherwise positive match. This differs from `grep -P` behavior. It does not repro for *positive* lookahead/lookbehind. Example: $ echo -e 'Bar\nBar Baz\nBat' > test.txt && git add test.txt $ git grep -P