From: Ævar Arnfjörð Bjarmason Date: Fri, 03 Feb 2023 21:56:53 GMT Subject: Re: grep: fix multibyte regex handling under macOS (1819ad327b7a1f19540a819813b70a0e8a7f798f) Message-ID: <230203.86357mbe8x.gmgdl@evledraar.gmail.com> In-Reply-To: On Fri, Feb 03 2023, Jeff King wrote: > On Thu, Feb 02, 2023 at 05:22:37PM +0100, demerphq wrote: > >> I've been lurking watching some of the regex discussion on the list >> and personally I think it is asking for trouble to use "whatever regex >> engine is traditional in a given environment" instead of just choosing >> a good open source engine and using it consistently everywhere. I >> don't really buy the arguments I have seen to justify a policy of "use >> the standard library version"; regex engines vary widely in >> performance and implementation and feature set, and even the really >> good ones do not entirely agree on every semantic[1], so if you don't >> standardize you will be forever dealing with bugs related to those >> differences. > > I think this is a perennial question for portable software: is it better > to be consistent across platforms (by shipping our own regex engine), or > consistent with other programs on the same platform (by using the system > regex). *nod* > I don't have a strong opinion either way. The main concern I'd have is > handling dependencies. I like pcre a lot, but I'm not sure that I would > want building Git to require pcre on every platform. If there's an > engine we can ship as a vendored dependency that builds everywhere, that > helps. We can just make that fallback engine be PCRE. I submitted patches a while ago to include a minimal version of it in compat/pcre, as we seem to have some allergy to external dependencies: https://lore.kernel.org/git/20170511175115.648-1-avarab@gmail.com/ It's ~80k lines instead of compat/regex's ~15k, but it's actually maintained, and would be much easier to upgrade.