]> git.ipfire.org Git - thirdparty/git.git/commitdiff
config.mak.uname: only set NO_REGEX on cygwin for v1.7
authorRamsay Jones <ramsay@ramsayjones.plus.com>
Wed, 16 Apr 2025 23:18:28 +0000 (00:18 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 17 Apr 2025 03:43:44 +0000 (20:43 -0700)
Commit 92f63d2b05 ("Cygwin 1.7 needs compat/regex", 2013-07-19) set
the NO_REGEX build variable because the platform regex library failed
some of the tests (t4018 and t4034), which passed just fine with the
compat library.

After some time (maybe a year or two), the platform library had been
updated (with an import from FreeBSD, I believe) and now passed the full
test-suite. This would be about the time of the v1.7 -> v2.0 transition
in 2015. I had a patch ready to send, but just didn't get around to
submitting it to the list. At some point in the interim, the official
cygwin git package used the autoconf build system, which sets the
NO_REGEX variable to use the platform regex library functions. The new
meson build system does likewise.

The cygwin platform regex library, in addition to now passing the tests
which formerly failed, now passes an 'test_expect_failure' test in the
t7815-grep-binary test file. In particular, test #12 'git grep .fi a'
which determines that the regex pattern '.' matches a NUL character.
The commit f96e56733a ("grep: use REG_STARTEND for all matching if
available", 2010-05-22) added the test in question, but it does not
give any indication as to why the test was framed as an expected fail,
rather than a 'positive' test that the 'git grep' command fails to
match a NUL. Note that the previous test #11 was also originally
marked in that commit as a 'test_expect_failure', but was flipped to
an 'success' test in commit 7e36de5859 ("t/t7008-grep-binary.sh: un-TODO
a test that needs REG_STARTEND", 2010-08-17).

In order to produce the same NO_REGEX configuration from autoconf, meson
and make, modify config.mak.uname to only set NO_REGEX for cygwin v1.7.
In addition, skip test t7815.12 on cygwin, by adding the !CYGWIN pre-
requisite to the test header, which (among other things) removes an
'...; please update test(s)' comment.

Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
config.mak.uname
t/t7815-grep-binary.sh

index ae6ba1558603f7804661f421c5bc409bd81a7245..b6adce0bc467fdebbb307802eee37bb0cb1d6d4b 100644 (file)
@@ -245,7 +245,9 @@ ifeq ($(uname_O),Cygwin)
                # Try commenting this out if you suspect MMAP is more efficient
                NO_MMAP = YesPlease
         else
-               NO_REGEX = UnfortunatelyYes
+                ifeq ($(shell expr "$(uname_R)" : '1\.7\.'),4)
+                       NO_REGEX = UnfortunatelyYes
+                endif
         endif
        HAVE_DEV_TTY = YesPlease
        HAVE_ALLOCA_H = YesPlease
index 90ebb64f46ebfaeed11c0a0d36cf015e415423b9..b7000dfa3226ff2d81168d3c375cfdd2b364c15d 100755 (executable)
@@ -63,7 +63,7 @@ test_expect_success 'git grep ile a' '
        git grep ile a
 '
 
-test_expect_failure 'git grep .fi a' '
+test_expect_failure !CYGWIN 'git grep .fi a' '
        git grep .fi a
 '