From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Adam Dinwoodie <adam@dinwoodie.org>
Cc: git@vger.kernel.org, "Junio C Hamano" <gitster@pobox.com>,
"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>,
"Anthony Ramine" <n.oxyde@gmail.com>,
"Ramsay Jones" <ramsay@ramsay1.demon.co.uk>,
"Johannes Sixt" <j6t@kdbg.org>
Subject: Re: [PATCH v2 7/7] wildmatch test: create & test files on disk in addition to in-memory
Date: Wed, 03 Jan 2018 14:31:12 +0100 [thread overview]
Message-ID: <87h8s3cbmn.fsf@evledraar.gmail.com> (raw)
In-Reply-To: <20180103130232.GD29210@dinwoodie.org>
On Wed, Jan 03 2018, Adam Dinwoodie jotted:
> On Monday 25 December 2017 at 12:28 am +0000, Ævar Arnfjörð Bjarmason wrote:
>> There has never been any full roundtrip testing of what git-ls-files
>> and other functions that use wildmatch() actually do, rather we've
>> been satisfied with just testing the underlying C function.
>>
>> Due to git-ls-files and friends having their own codepaths before they
>> call wildmatch() there's sometimes differences in the behavior between
>> the two, and even when we test for those (as with
>> 9e4e8a64c2 ("pathspec: die on empty strings as pathspec", 2017-06-06))
>> there was no one place where you can review how these two modes
>> differ.
>>
>> Now there is. We now attempt to create a file called $haystack and
>> match $needle against it for each pair of $needle and $haystack that
>> we were passing to test-wildmatch.
>>
>> If we can't create the file we skip the test. This ensures that we can
>> run this on all platforms and not maintain some infinitely growing
>> whitelist of e.g. platforms that don't support certain characters in
>> filenames.
>>
>> As a result of doing this we can now see the cases where these two
>> ways of testing wildmatch differ:
>>
>> * Creating a file called 'a[]b' and running ls-files 'a[]b' will show
>> that file, but wildmatch("a[]b", "a[]b") will not match
>>
>> * wildmatch() won't match a file called \ against \, but ls-files
>> will.
>>
>> * `git --glob-pathspecs ls-files 'foo**'` will match a file
>> 'foo/bba/arr', but wildmatch won't, however pathmatch will.
>>
>> This seems like a bug to me, the two are otherwise equivalent as
>> these tests show.
>>
>> This also reveals the case discussed in 9e4e8a64c2 above, where '' is
>> now an error as far as ls-files is concerned, but wildmatch() itself
>> happily accepts it.
>>
>> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
>
> I'm seeing this test script failing on the pu branch as a result of this
> commit when building on Cygwin. Specifically, the test fails at
> 9d45e1ca4 ("Merge branch 'bw/oidmap-autoinit' into pu", 2017-12-28), and
> bisecting points the blame at 2ee0c785a ("wildmatch test: create & test
> files on disk in addition to in-memory", 2017-12-25).
>
> I've copied the verbose error output for the first error below, and
> uploaded the full output, including verbose and trace output for the
> unexpectedly failing tests, at [0]. (With 42 failures among 1512 tests,
> there's a lot of it, so I didn't want to include it in an email.)
Does the fixup above in <878tdm8k2d.fsf@evledraar.gmail.com> work for
you, i.e. changing $10 in the script to ${10}?
I was waiting on Junio to see if he'd like to just squash that or if I
should re-send.
> expecting success:
> wildtest_file_setup &&
> printf '%s' '\' >expect &&
> git --glob-pathspecs ls-files -z -- '00' >actual.raw 2>actual.err &&
> wildtest_stdout_stderr_cmp
>
> ++ wildtest_file_setup
> ++ test_when_finished '
> rm -rf -- * &&
> git reset
> '
> ++ test 0 = 0
> ++ test_cleanup='{
> rm -rf -- * &&
> git reset
>
> } && (exit "$eval_ret"); eval_ret=$?; :'
> ++ git add -A
> ++ printf %s '\'
> ++ git --glob-pathspecs ls-files -z -- 00
> ++ wildtest_stdout_stderr_cmp
> ++ tr -d '\0'
> ++ test_cmp expect.err actual.err
> ++ diff -u expect.err actual.err
> ++ test_cmp expect actual
> ++ diff -u expect actual
> --- expect 2018-01-03 12:43:11.116611200 +0000
> +++ actual 2018-01-03 12:43:11.216180400 +0000
> @@ -1 +0,0 @@
> -\
> \ No newline at end of file
> + test_eval_ret_=1
> + want_trace
> + test t = t
> + test t = t
> + set +x
> error: last command exited with $?=1
> ++ rm -rf -- actual actual.err actual.raw expect expect.err
> ++ git reset
> ++ exit 1
> ++ eval_ret=1
> ++ :
> + test_eval_ret_=0
> + want_trace
> + test t = t
> + test t = t
> + set +x
> not ok 490 - wildmatch(ls): match '00' '\'
> #
> # wildtest_file_setup &&
> # printf '%s' '\' >expect &&
> # git --glob-pathspecs ls-files -z -- '00' >actual.raw 2>actual.err &&
> # wildtest_stdout_stderr_cmp
> #
>
> I'm digging into the failures myself now, but wanted to report the
> problem in the name of getting more eyes on it.
>
> Adam
>
> [0]: https://gist.github.com/me-and/04443bcb00e12436f0eacce079b56d02
next prev parent reply other threads:[~2018-01-03 13:31 UTC|newest]
Thread overview: 73+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-23 21:30 [PATCH 0/6] increase wildmatch test coverage Ævar Arnfjörð Bjarmason
2017-12-23 21:30 ` [PATCH 1/6] wildmatch test: indent with tabs, not spaces Ævar Arnfjörð Bjarmason
2017-12-23 21:30 ` [PATCH 2/6] wildmatch test: use more standard shell style Ævar Arnfjörð Bjarmason
2017-12-23 21:30 ` [PATCH 3/6] wildmatch test: use a paranoia pattern from nul_match() Ævar Arnfjörð Bjarmason
2017-12-23 21:30 ` [PATCH 4/6] wildmatch test: remove dead fnmatch() test code Ævar Arnfjörð Bjarmason
2017-12-23 21:30 ` [PATCH 5/6] wildmatch test: perform all tests under all wildmatch() modes Ævar Arnfjörð Bjarmason
2017-12-23 21:30 ` [PATCH 6/6] wildmatch test: create & test files on disk in addition to in-memory Ævar Arnfjörð Bjarmason
2017-12-24 9:24 ` Johannes Sixt
2017-12-24 11:06 ` Ævar Arnfjörð Bjarmason
2017-12-24 11:51 ` Johannes Sixt
2017-12-25 0:28 ` [PATCH v2 0/7] increase wildmatch test coverage Ævar Arnfjörð Bjarmason
2017-12-28 22:48 ` Junio C Hamano
2017-12-28 23:49 ` Ævar Arnfjörð Bjarmason
2017-12-28 23:28 ` [PATCH v3 " Ævar Arnfjörð Bjarmason
2017-12-28 23:28 ` [PATCH v3 1/7] wildmatch test: indent with tabs, not spaces Ævar Arnfjörð Bjarmason
2017-12-28 23:28 ` [PATCH v3 2/7] wildmatch test: use more standard shell style Ævar Arnfjörð Bjarmason
2017-12-28 23:28 ` [PATCH v3 3/7] wildmatch test: don't try to vertically align our output Ævar Arnfjörð Bjarmason
2017-12-28 23:28 ` [PATCH v3 4/7] wildmatch test: use a paranoia pattern from nul_match() Ævar Arnfjörð Bjarmason
2017-12-28 23:28 ` [PATCH v3 5/7] wildmatch test: remove dead fnmatch() test code Ævar Arnfjörð Bjarmason
2017-12-28 23:28 ` [PATCH v3 6/7] wildmatch test: perform all tests under all wildmatch() modes Ævar Arnfjörð Bjarmason
2017-12-28 23:28 ` [PATCH v3 7/7] wildmatch test: create & test files on disk in addition to in-memory Ævar Arnfjörð Bjarmason
2017-12-29 0:16 ` Ævar Arnfjörð Bjarmason
2017-12-25 0:28 ` [PATCH v2 1/7] wildmatch test: indent with tabs, not spaces Ævar Arnfjörð Bjarmason
2017-12-25 0:28 ` [PATCH v2 2/7] wildmatch test: use more standard shell style Ævar Arnfjörð Bjarmason
2017-12-25 0:28 ` [PATCH v2 3/7] wildmatch test: don't try to vertically align our output Ævar Arnfjörð Bjarmason
2017-12-25 0:28 ` [PATCH v2 4/7] wildmatch test: use a paranoia pattern from nul_match() Ævar Arnfjörð Bjarmason
2017-12-25 0:28 ` [PATCH v2 5/7] wildmatch test: remove dead fnmatch() test code Ævar Arnfjörð Bjarmason
2017-12-25 0:28 ` [PATCH v2 6/7] wildmatch test: perform all tests under all wildmatch() modes Ævar Arnfjörð Bjarmason
2017-12-28 20:28 ` Junio C Hamano
2017-12-25 0:28 ` [PATCH v2 7/7] wildmatch test: create & test files on disk in addition to in-memory Ævar Arnfjörð Bjarmason
2017-12-25 9:26 ` Johannes Sixt
2017-12-27 19:07 ` Junio C Hamano
2018-01-03 13:02 ` Adam Dinwoodie
2018-01-03 13:31 ` Ævar Arnfjörð Bjarmason [this message]
2018-01-03 14:41 ` Adam Dinwoodie
2018-01-03 19:14 ` Ævar Arnfjörð Bjarmason
2018-01-04 11:50 ` Adam Dinwoodie
2018-01-04 19:26 ` [PATCH v4 0/7] increase wildmatch test coverage Ævar Arnfjörð Bjarmason
2018-01-30 21:21 ` [PATCH v5 00/10] " Ævar Arnfjörð Bjarmason
2018-01-30 21:21 ` [PATCH v5 01/10] wildmatch test: indent with tabs, not spaces Ævar Arnfjörð Bjarmason
2018-01-30 21:21 ` [PATCH v5 02/10] wildmatch test: use more standard shell style Ævar Arnfjörð Bjarmason
2018-01-30 21:21 ` [PATCH v5 03/10] wildmatch test: don't try to vertically align our output Ævar Arnfjörð Bjarmason
2018-01-30 21:21 ` [PATCH v5 04/10] wildmatch test: use a paranoia pattern from nul_match() Ævar Arnfjörð Bjarmason
2018-01-30 21:21 ` [PATCH v5 05/10] wildmatch test: remove dead fnmatch() test code Ævar Arnfjörð Bjarmason
2018-01-30 21:21 ` [PATCH v5 06/10] wildmatch test: use test_must_fail, not ! for test-wildmatch Ævar Arnfjörð Bjarmason
2018-01-30 21:21 ` [PATCH v5 07/10] wildmatch test: perform all tests under all wildmatch() modes Ævar Arnfjörð Bjarmason
2018-01-30 21:21 ` [PATCH v5 08/10] wildmatch test: create & test files on disk in addition to in-memory Ævar Arnfjörð Bjarmason
2018-01-30 21:21 ` [PATCH v5 09/10] test-lib: add an EXPENSIVE_ON_WINDOWS prerequisite Ævar Arnfjörð Bjarmason
2018-01-30 21:21 ` [PATCH v5 10/10] wildmatch test: mark test as EXPENSIVE_ON_WINDOWS Ævar Arnfjörð Bjarmason
2018-01-04 19:26 ` [PATCH v4 1/7] wildmatch test: indent with tabs, not spaces Ævar Arnfjörð Bjarmason
2018-01-04 19:26 ` [PATCH v4 2/7] wildmatch test: use more standard shell style Ævar Arnfjörð Bjarmason
2018-01-04 19:26 ` [PATCH v4 3/7] wildmatch test: don't try to vertically align our output Ævar Arnfjörð Bjarmason
2018-01-04 19:26 ` [PATCH v4 4/7] wildmatch test: use a paranoia pattern from nul_match() Ævar Arnfjörð Bjarmason
2018-01-04 19:26 ` [PATCH v4 5/7] wildmatch test: remove dead fnmatch() test code Ævar Arnfjörð Bjarmason
2018-01-04 19:26 ` [PATCH v4 6/7] wildmatch test: perform all tests under all wildmatch() modes Ævar Arnfjörð Bjarmason
2018-01-04 19:26 ` [PATCH v4 7/7] wildmatch test: create & test files on disk in addition to in-memory Ævar Arnfjörð Bjarmason
2018-01-05 16:41 ` Johannes Schindelin
2018-01-05 19:08 ` Ævar Arnfjörð Bjarmason
2018-01-05 20:48 ` Johannes Schindelin
2018-01-05 22:12 ` [PATCH v4 8/7] wildmatch test: skip file creation tests on Windows proper Ævar Arnfjörð Bjarmason
2018-01-05 23:13 ` Junio C Hamano
2018-01-06 12:51 ` Johannes Schindelin
2018-01-06 13:32 ` Ævar Arnfjörð Bjarmason
2018-01-06 20:46 ` Johannes Schindelin
2018-01-08 12:46 ` Johannes Schindelin
2018-01-08 18:49 ` Junio C Hamano
2018-01-07 2:51 ` Duy Nguyen
2018-01-08 12:25 ` Johannes Schindelin
2018-01-10 9:07 ` Duy Nguyen
2018-01-10 10:38 ` Adam Dinwoodie
2018-01-10 10:52 ` Duy Nguyen
2018-01-10 20:24 ` Johannes Schindelin
2018-01-11 9:25 ` Duy Nguyen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87h8s3cbmn.fsf@evledraar.gmail.com \
--to=avarab@gmail.com \
--cc=adam@dinwoodie.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=j6t@kdbg.org \
--cc=n.oxyde@gmail.com \
--cc=pclouds@gmail.com \
--cc=ramsay@ramsay1.demon.co.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).