git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 4, 2016, 22:09 UTC
Message-ID
<CAPc5daVPpeCTLbo4t7gRbKbP=BMnhHHtE68uXjanQDS2nKc4dw@mail.gmail.com>
In-Reply-To
<CACi5S_2j+PXFwE755CSiE01=sYALx-17Hk1k8zJOR9_Fj7y9Pg@mail.gmail.com>

On Thu, Aug 4, 2016 at 11:54 AM, Michael Giuffrida <michaelpg@chromium.org> wrote:

Show 10 quoted lines
> On Mon, Aug 1, 2016 at 2:35 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> 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.
Previous: Michael Giuffrida
Message 4 of 4 in “git grep -P is multiline for negative lookahead/behind”
  1. Michael GiuffridaAug 1, 2016
  2. Junio C HamanoAug 1, 2016
  3. Michael GiuffridaAug 4, 2016
  4. Junio C HamanoAug 4, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.