[patch] improved ignore pattern matching (#57637)

Kent Gibson warthog618 at gmail.com
Tue Nov 28 10:35:53 GMT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



Jan Hudec wrote:
> On Tue, Nov 28, 2006 at 08:20:52AM +0800, Kent Gibson wrote:
>> Just to confirm, and without going into the details of the regex
>> to translate it to (sorry I'm pushed for time), is it fair to say
>> we want the swallowing of a trailing '/' for the case where '**'
>> matches the empty string to only occur where the '**' is at the
>> beginning of a component? For all other occurances of '**' we
>> fall back to the "**" matches anything. i.e. foo**/CVS will match
>> foobar/CVS but not fooCVS. But foo/**/CVS will match foo/CVS as
>> well as foo/bar/CVS.
>
> That would be a sane semantics.
>
> Though you did not say that foo**/CVS matches foobar/baz/CVS. In
> zsh it would NOT, because ** is not recognized except as whole
> component. But we surely can recognize it in such case.
>
I didn't mention that foo**/CVS would match foobar/baz/CVS, but you
are correct that it would.

But now I'm thinking that the zsh way might be better.
The only advantage of the semantics above that I can see is that
foo**/CVS is short for foo*/**/CVS.
I'm not sure the short form is any clearer, or in fact if there is any
sensible application for such a pattern.

One other thing - while I was updating the help for the ignore command
I noticed this:

    Ignore patterns are case-insensitive on case-insensitive systems.

Working on a case-sensitive system, this wasn't something that had
occurred to me.
Is this true?  If so I'll need to set the IGNORECASE flag for
case-insensitive systems.
Is there a simple way to tell that a system is case-insensitive?

Cheers,
Kent.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFbBEJgoxTFTi1P8QRAvF7AJ4y14y+iZc2/kq4CQHSfsOGHPoWBgCfeC2z
BtG1E53tMEnZG5i9oiI46b4=
=0hA4
-----END PGP SIGNATURE-----




More information about the bazaar mailing list