Re: git grep -P is multiline for negative lookahead/behind
- From
- Michael Giuffrida <michaelpg@chromium.org>
- Date
- Aug 4, 2016, 18:54 UTC
- Message-ID
- <CACi5S_2j+PXFwE755CSiE01=sYALx-17Hk1k8zJOR9_Fj7y9Pg@mail.gmail.com>
- In-Reply-To
- <xmqqr3a8goka.fsf@gitster.mtv.corp.google.com>
On Mon, Aug 1, 2016 at 2:35 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 8 quoted lines
> Michael Giuffrida <michaelpg@chromium.org> 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?
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.