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

Re: git bug: Perl compatible regular expressions do not work as expected

From
René Scharfe <l.s.r@web.de>
Date
Mar 27, 2023, 17:23 UTC
Message-ID
<03fd7ddb-8241-1a0a-3e82-d8083e4ce0f7@web.de>
In-Reply-To
<xmqqh6u6cg4l.fsf@gitster.g>
Am 27.03.23 um 18:29 schrieb Junio C Hamano:
Show 11 quoted lines
> René Scharfe <l.s.r@web.de> writes:
>
>> Or to enable REG_ENHANCED
>> for them, at least, like 54463d32ef (use enhanced basic regular
>> expressions on macOS, 2023-01-08) did to get alternations for git grep
>> on macOS.
>
> This one sounds like a reasonable thing, which may not have huge
> unintended fallout, to do.  I am a bit surprised that we have to
> cover each individual callsite of regcomp(3), though.  Doesn't the
> 54463d32ef fix use "#define regcomp git_regcomp" to cover everybody?

54463d32ef only affects basic regular expressions (BRE), but -G and -S use extended ones (ERE). macOS allows both to be "enhanced".

I have a hard time finding a readable reference to the documentation to brings us all onto the same page regarding what REG_ENHANCED actually does. [1] is in raw troff format, [2] isn't very pretty and shows ads. Anyway, the rather lengthy section "ENHANCED FEATURES" explains it.

René

[1] https://opensource.apple.com/source/Libc/Libc-1439.40.11/regex/FreeBSD/re_format.7.auto.html [2] https://www.unix.com/man-page/osx/7/re_format/

Previous: Junio C HamanoNext: Junio C Hamano
Message 9 of 18 in “git bug: Perl compatible regular expressions do not work as expected”
  1. Mario GrgicMar 25, 2023
  2. Kristoffer HaugsbakkMar 25, 2023
  3. Mario GrgicMar 25, 2023
  4. demerphqMar 25, 2023
  5. Mario GrgicMar 25, 2023
  6. demerphqMar 25, 2023
  7. René ScharfeMar 25, 2023
  8. Junio C HamanoMar 27, 2023
  9. René ScharfeMar 27, 2023
  10. Junio C HamanoMar 27, 2023
  11. Junio C HamanoMar 28, 2023
  12. René ScharfeMar 28, 2023
  13. Mario GrgicMar 25, 2023
  14. Mario GrgicMar 25, 2023
  15. Junio C HamanoMar 27, 2023
  16. Mario GrgicMar 27, 2023
  17. Junio C HamanoMar 27, 2023
  18. Mario GrgicMar 28, 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.