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

Re: regex compilation error with --color-words

From
Diomidis Spinellis <dds@aueb.gr>
Date
Mar 30, 2023, 07:55 UTC
Message-ID
<b45bf46f-580a-870c-5293-10ecdf2e56d3@aueb.gr>
In-Reply-To
<CAPig+cSNmws2b7f7aRA2C56kvQYG3w_g+KhYdqhtmf+XhtAMhQ@mail.gmail.com>
On 30-Mar-23 1:55, Eric Sunshine wrote:
> I'm encountering a failure on macOS High Sierra 10.13.6 when using
> --color-words:

The built-in word separation regular expression pattern for the Perl language fails to work with the macOS regex engine. The same also happens with the FreeBSD one (tested on 14.0).

The issue can be replicated through the following sequence of commands.

git init color-words cd color-words echo '*.pl diff=perl' >.gitattributes echo 'print 42;' >t.pl git add t.pl git commit -am Add git show --color-words

Strangely, I haven't been able to reproduce the failure with egrep on any of the two platforms.

egrep '[[:alpha:]_'\''][[:alnum:]_'\'']*|0[xb]?[0-9a-fA-F_]*|[0-9a-fA-F_]+(\.[0-9a-fA-F_]+)?([eE][-+]?[0-9_]+)?|=>|-[rwxoRWXOezsfdlpSugkbctTBMAC>]|~~|::|&&=|\|\|=|//=|\*\*=|&&|\|\||//|\+\+|--|\*\*|\.\.\.?|[-+*/%.^&<>=!|]=|=~|!~|<<|<>|<=>|>>|[^[:space:]]|[\xc0-\xff][\x80-\xbf]+' /dev/null

Previous: Eric SunshineNext: René Scharfe
Message 2 of 13 in “regex compilation error with --color-words”
  1. Eric SunshineMar 29, 2023
  2. Diomidis SpinellisMar 30, 2023
  3. René ScharfeMar 31, 2023
  4. René ScharfeApr 2, 2023
  5. Junio C HamanoApr 3, 2023
  6. René ScharfeApr 3, 2023
  7. userdiff: support regexec(3) with multi-byte supportRené Scharfe, Apr 6, 2023
  8. Johannes SixtApr 6, 2023
  9. René ScharfeApr 7, 2023
  10. Johannes SixtApr 7, 2023
  11. D. Ben KnobleApr 7, 2023
  12. Junio C HamanoApr 7, 2023
  13. Eric SunshineApr 7, 2023

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.