Re: grep: fix multibyte regex handling under macOS (1819ad327b7a1f19540a819813b70a0e8a7f798f)
- From
Jeff King <peff@peff.net>
- Date
- Feb 7, 2023, 18:23 UTC
- Message-ID
- <Y+KXC5b0qUg2/nxt@coredump.intra.peff.net>
- In-Reply-To
- <CALnO6CC2w5LUAjXVw7CWKAVobjFMc7M7jm7HuuGT1SO0q5cYbA@mail.gmail.com>
On Sun, Feb 05, 2023 at 02:51:05PM -0500, D. Ben Knoble wrote:
> Any thoughts on some sort of stop-gap measure to fix --word-diff while > Git decides how to handle the regex engine incompatibilities? How > important is the sequence of bytes at the end of --word-diff regexes > in userdiff.c?
It comes from 664d44ee7f (userdiff: simplify word-diff safeguard, 2011-01-11). So presumably we'd want to figure out a way to accomplish the same thing in a portable way. I'm not sure that's possible, though, without making assumptions about the regex engine.
There's a little more discussion in the original thread:
https://lore.kernel.org/git/561247.22837.qm@web110707.mail.gq1.yahoo.com/
but I didn't read it very carefully.
It may also be possible to play tricks with LC_CTYPE (either not setting it, or resetting before/after a regex), but that feels pretty hacky.
-Peff