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

3 messages, 2 authors, 2016-08-04 · open the first message on its own page

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

From: Junio C Hamano <hidden>
Date: 2016-08-01 21:42:29

Michael Giuffrida [off-list ref] 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 that explain the observed
symptom?

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

From: Michael Giuffrida <hidden>
Date: 2016-08-04 18:54:58

On Mon, Aug 1, 2016 at 2:35 PM, Junio C Hamano [off-list ref] wrote:
Michael Giuffrida [off-list ref] writes:
quoted
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 that explain the observed
symptom?
No. If it worked line-by-line, it would produce more results. It is
not producing the expected matches because it *is* considering the
previous line in negative lookbehind, when I don't want or expect it
to. Thus it throws out results that should match.

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

From: Junio C Hamano <hidden>
Date: 2016-08-04 22:09:47

On Thu, Aug 4, 2016 at 11:54 AM, Michael Giuffrida
[off-list ref] wrote:
On Mon, Aug 1, 2016 at 2:35 PM, Junio C Hamano [off-list ref] wrote:
quoted
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 that explain the observed
symptom?
No. If it worked line-by-line, it would produce more results. It is
not producing the expected matches because it *is* considering the
previous line in negative lookbehind, when I don't want or expect it
to. Thus it throws out results that should match.
If that is the case I do not know what is going on; perhaps
somebody more familiar with the pcre codepath can help.

Sorry.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help