# [PATCH] wildmatch test: cover a blind spot in "/" matching

5 messages from 2017-05-27 to 2017-06-10. Participants: Ævar Arnfjörð Bjarmason, Junio C Hamano.
Thread: https://gitlist.dev/t/46055

## Ævar Arnfjörð Bjarmason, 2017-05-27 09:13

Subject: [PATCH] wildmatch test: cover a blind spot in "/" matching
Message-ID: <0102015c492e27c6-669f7ca8-e7c6-484f-9c5b-7cb9358ee966-000000@eu-west-1.amazonses.com>
URL: https://gitlist.dev/e/0102015c492e27c6-669f7ca8-e7c6-484f-9c5b-7cb9358ee966-000000%40eu-west-1.amazonses.com

```
Add a test which covers a blindspot in how these tests should assert
that negated character classes are allowed or not allowed to match "/"
in certain circumstances.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 t/t3070-wildmatch.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/t/t3070-wildmatch.sh b/t/t3070-wildmatch.sh
index ef509df35160..65ea07b68356 100755
--- a/t/t3070-wildmatch.sh
+++ b/t/t3070-wildmatch.sh
@@ -82,6 +82,7 @@ match 1 0 'foo/bar' 'foo/**/bar'
 match 1 0 'foo/bar' 'foo/**/**/bar'
 match 0 0 'foo/bar' 'foo?bar'
 match 0 0 'foo/bar' 'foo[/]bar'
+match 0 0 'foo/bar' 'foo[^a-z]bar'
 match 0 0 'foo/bar' 'f[^eiu][^eiu][^eiu][^eiu][^eiu]r'
 match 1 1 'foo-bar' 'f[^eiu][^eiu][^eiu][^eiu][^eiu]r'
 match 1 0 'foo' '**/foo'
@@ -226,6 +227,7 @@ pathmatch 0 foo/bba/arr 'foo/*z'
 pathmatch 0 foo/bba/arr 'foo/**z'
 pathmatch 1 foo/bar 'foo?bar'
 pathmatch 1 foo/bar 'foo[/]bar'
+pathmatch 1 foo/bar 'foo[^a-z]bar'
 pathmatch 0 foo '*/*/*'
 pathmatch 0 foo/bar '*/*/*'
 pathmatch 1 foo/bba/arr '*/*/*'

--
https://github.com/git/git/pull/362

```

## Ævar Arnfjörð Bjarmason, 2017-06-09 16:21

Subject: Re: [PATCH] wildmatch test: cover a blind spot in "/" matching
Message-ID: <CACBZZX44Wc1c2RXfnZMu4cX8NAkdyuaktxZpCWcWK83oiJ2iRQ@mail.gmail.com>
URL: https://gitlist.dev/e/CACBZZX44Wc1c2RXfnZMu4cX8NAkdyuaktxZpCWcWK83oiJ2iRQ%40mail.gmail.com
In-Reply-To: <0102015c492e27c6-669f7ca8-e7c6-484f-9c5b-7cb9358ee966-000000@eu-west-1.amazonses.com>

```
On Sat, May 27, 2017 at 11:13 AM, Ævar Arnfjörð Bjarmason
<avarab@gmail.com> wrote:
> Add a test which covers a blindspot in how these tests should assert
> that negated character classes are allowed or not allowed to match "/"
> in certain circumstances.

Junio: I didn't CC you on this, because I probably clicked some wrong
option in submitgit which I was testing for this patch. Could you
please queue this one?

> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
> ---
>  t/t3070-wildmatch.sh | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/t/t3070-wildmatch.sh b/t/t3070-wildmatch.sh
> index ef509df35160..65ea07b68356 100755
> --- a/t/t3070-wildmatch.sh
> +++ b/t/t3070-wildmatch.sh
> @@ -82,6 +82,7 @@ match 1 0 'foo/bar' 'foo/**/bar'
>  match 1 0 'foo/bar' 'foo/**/**/bar'
>  match 0 0 'foo/bar' 'foo?bar'
>  match 0 0 'foo/bar' 'foo[/]bar'
> +match 0 0 'foo/bar' 'foo[^a-z]bar'
>  match 0 0 'foo/bar' 'f[^eiu][^eiu][^eiu][^eiu][^eiu]r'
>  match 1 1 'foo-bar' 'f[^eiu][^eiu][^eiu][^eiu][^eiu]r'
>  match 1 0 'foo' '**/foo'
> @@ -226,6 +227,7 @@ pathmatch 0 foo/bba/arr 'foo/*z'
>  pathmatch 0 foo/bba/arr 'foo/**z'
>  pathmatch 1 foo/bar 'foo?bar'
>  pathmatch 1 foo/bar 'foo[/]bar'
> +pathmatch 1 foo/bar 'foo[^a-z]bar'
>  pathmatch 0 foo '*/*/*'
>  pathmatch 0 foo/bar '*/*/*'
>  pathmatch 1 foo/bba/arr '*/*/*'
>
> --
> https://github.com/git/git/pull/362

```

## Junio C Hamano, 2017-06-10 01:55

Subject: Re: [PATCH] wildmatch test: cover a blind spot in "/" matching
Message-ID: <xmqqlgp04ne3.fsf@gitster.mtv.corp.google.com>
URL: https://gitlist.dev/e/xmqqlgp04ne3.fsf%40gitster.mtv.corp.google.com
In-Reply-To: <0102015c492e27c6-669f7ca8-e7c6-484f-9c5b-7cb9358ee966-000000@eu-west-1.amazonses.com>

```
Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:

> Add a test which covers a blindspot in how these tests should assert
> that negated character classes are allowed or not allowed to match "/"
> in certain circumstances.

Please make this a bit more explicit, something like

	A negated character class that does not include '/',
	e.g. [^a-z],

        - should match '/' when doing "wildmatch"
	- should not match '/' when doing "pathmatch"

	Add two tests to cover these cases.

Thanks.

> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
> ---
>  t/t3070-wildmatch.sh | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/t/t3070-wildmatch.sh b/t/t3070-wildmatch.sh
> index ef509df35160..65ea07b68356 100755
> --- a/t/t3070-wildmatch.sh
> +++ b/t/t3070-wildmatch.sh
> @@ -82,6 +82,7 @@ match 1 0 'foo/bar' 'foo/**/bar'
>  match 1 0 'foo/bar' 'foo/**/**/bar'
>  match 0 0 'foo/bar' 'foo?bar'
>  match 0 0 'foo/bar' 'foo[/]bar'
> +match 0 0 'foo/bar' 'foo[^a-z]bar'
>  match 0 0 'foo/bar' 'f[^eiu][^eiu][^eiu][^eiu][^eiu]r'
>  match 1 1 'foo-bar' 'f[^eiu][^eiu][^eiu][^eiu][^eiu]r'
>  match 1 0 'foo' '**/foo'
> @@ -226,6 +227,7 @@ pathmatch 0 foo/bba/arr 'foo/*z'
>  pathmatch 0 foo/bba/arr 'foo/**z'
>  pathmatch 1 foo/bar 'foo?bar'
>  pathmatch 1 foo/bar 'foo[/]bar'
> +pathmatch 1 foo/bar 'foo[^a-z]bar'
>  pathmatch 0 foo '*/*/*'
>  pathmatch 0 foo/bar '*/*/*'
>  pathmatch 1 foo/bba/arr '*/*/*'
>
> --
> https://github.com/git/git/pull/362

```

## Junio C Hamano, 2017-06-10 01:57

Subject: Re: [PATCH] wildmatch test: cover a blind spot in "/" matching
Message-ID: <xmqqh8zo4na3.fsf@gitster.mtv.corp.google.com>
URL: https://gitlist.dev/e/xmqqh8zo4na3.fsf%40gitster.mtv.corp.google.com
In-Reply-To: <xmqqlgp04ne3.fsf@gitster.mtv.corp.google.com>

```
Junio C Hamano <gitster@pobox.com> writes:

> Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:
>
>> Add a test which covers a blindspot in how these tests should assert
>> that negated character classes are allowed or not allowed to match "/"
>> in certain circumstances.
>
> Please make this a bit more explicit, something like
>
> 	A negated character class that does not include '/',
> 	e.g. [^a-z],

oops.  I think the class includes '/'; please excuse loose logic in
a "something like" meant as an illustration to show the level of
details expected ;-)

```

## Ævar Arnfjörð Bjarmason, 2017-06-10 11:31

Subject: Re: [PATCH] wildmatch test: cover a blind spot in "/" matching
Message-ID: <87wp8krsde.fsf@gmail.com>
URL: https://gitlist.dev/e/87wp8krsde.fsf%40gmail.com
In-Reply-To: <xmqqh8zo4na3.fsf@gitster.mtv.corp.google.com>

```

On Sat, Jun 10 2017, Junio C. Hamano jotted:

> Junio C Hamano <gitster@pobox.com> writes:
>
>> Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:
>>
>>> Add a test which covers a blindspot in how these tests should assert
>>> that negated character classes are allowed or not allowed to match "/"
>>> in certain circumstances.
>>
>> Please make this a bit more explicit, something like
>>
>> 	A negated character class that does not include '/',
>> 	e.g. [^a-z],
>
> oops.  I think the class includes '/'; please excuse loose logic in
> a "something like" meant as an illustration to show the level of
> details expected ;-)

Thanks for the feedback. Sorry I'm slightly confused still (after
reading this over a couple of times), are you OK with this patch/commit
message as-is or would you still like some clarification there?

```
