From: Jeff King Date: Tue, 07 Feb 2023 18:23:07 GMT Subject: Re: grep: fix multibyte regex handling under macOS (1819ad327b7a1f19540a819813b70a0e8a7f798f) Message-ID: In-Reply-To: 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