Hi Ævar,

On Mon, 1 Jul 2019, Ævar Arnfjörð Bjarmason wrote:

> This v3 has a new patch (3/10) that I believe fixes the regression on
> MinGW Johannes noted in
> https://public-inbox.org/git/nycvar.qro.7.76.6.1907011515150...@tvgsbejvaqbjf.bet/

Yes.

However, I probably failed to mention another breakage, though...:

not ok 54 - LC_ALL='C' git grep -P -f f -i 'Æ<NUL>[Ð]' a

 expecting success:
                        >stderr &&
                        printf 'ÆQ[Ð]' | q_to_nul >f &&
                        test_must_fail env LC_ALL="C" git grep -P -f f -i a 
2>stderr &&
                        test_i18ngrep ! 'This is only supported with -P under 
PCRE v2' stderr

++ printf 'ÆQ[Ð]'
++ q_to_nul
++ perl -pe 'y/Q/\000/'
++ command /usr/bin/perl -pe 'y/Q/\000/'
++ /usr/bin/perl -pe 'y/Q/\000/'
++ test_must_fail env LC_ALL=C git grep -P -f f -i a
++ case "$1" in
++ _test_ok=
++ env LC_ALL=C git grep -P -f f -i a
Binary file a matches
++ exit_code=0
++ test 0 -eq 0
++ list_contains '' success
++ case ",$1," in
++ return 1
++ echo 'test_must_fail: command succeeded: env LC_ALL=C git grep -P -f f -i a'
test_must_fail: command succeeded: env LC_ALL=C git grep -P -f f -i a
++ return 1
error: last command exited with $?=1

There are three more test cases in that test script that fail similarly. See
https://dev.azure.com/Git-for-Windows/git/_build/results?buildId=38852&view=ms.vss-test-web.build-test-results-tab&runId=1019770&resultId=101368&paneView=debug

I ran out of time to look into this in more detail :-(

> As noted in the updated commit message in 10/10 I believe just
> skipping this test & documenting this in a commit message is the least
> amount of suck for now. It's really an existing issue with us doing
> nothing sensible when the log/grep haystack encoding doesn't match the
> needle encoding supplied via the command line.
>
> We swept that under the carpet with the kwset backend, but PCRE v2
> exposes it.

Please note that the problem is _not_ MinGW! The problem is that the
non-JIT'ted code path is a lot more stringent than the JIT'ted one. So
what you'd need is a prerequisite that tests whether the PCREv2 in use
supports JIT'ted code or not, and skip the test case in the latter one.

Or you fix the code by re-encoding the plain text in UTF-8 if we know that
it is not UTF-8-encoded but the needle is.

Ciao,
Dscho

Reply via email to