]> git.ipfire.org Git - thirdparty/git.git/commitdiff
regexp: leave a pointer to resurrect workaround for Homebrew
authorJunio C Hamano <gitster@pobox.com>
Mon, 23 Mar 2026 16:54:42 +0000 (09:54 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 25 Mar 2026 22:04:30 +0000 (15:04 -0700)
Recently some GitHub CI jobs were broken by update on the platform
side, which was eventually resolved by image rollback, but in the
meantime Dscho invented a workaround patch to sidestep the broken
part of the platform.  Their future image update may contain the
same bug, in which case the workaround may again become needed.

As we do not want to be building with workaround that avoids system
regexp library altogether unless the system is known to be broken,
so short of an automated "detect broken system and apply workaround"
mechanism, let's use the folks who are compiling the code to detect
breakage on their system and cope with the breakage ;-)

Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/regcomp_enhanced.c

index 84193ce53b64f5ff98bbcc3c4869c53a7796a17e..29c74eee995043b890b9bc76cf3c5f1f83bc99d9 100644 (file)
@@ -3,6 +3,11 @@
 
 int git_regcomp(regex_t *preg, const char *pattern, int cflags)
 {
+       /*
+        * If you are on macOS with clang and fail to compile this line,
+        * https://lore.kernel.org/git/458ad3c1-96df-4575-ee42-e6eb754f25f6@gmx.de/
+        * might be relevant.
+        */
        if (!(cflags & REG_EXTENDED))
                cflags |= REG_ENHANCED;
        return regcomp(preg, pattern, cflags);