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

Re: bug: git grep -P and multiline mode

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 23, 2014, 17:42 UTC
Message-ID
<xmqqa993cykl.fsf@gitster.dls.corp.google.com>
In-Reply-To
<53A7CF25.7060508@gmail.com>
Noel Grandin <noelgrandin@gmail.com> writes:
> It looks like the perl regular expression multiline mode does not work with 'git grep'

Yes, and deliberately so, to avoid having to think about things like "how would a multi-line match interact with 'grep -n'?"

We behave as if we feed each line of the contents one line at a time to the matching engine that is chosen by the -P/-E/-G/-F optoins, so this limitation is unlikely to change.

Previous: Noel GrandinNext: Noel Grandin
Message 2 of 3 in “bug: git grep -P and multiline mode”
  1. Noel GrandinJun 23, 2014
  2. Junio C HamanoJun 23, 2014
  3. Noel GrandinJun 24, 2014

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.