[patch] improved ignore pattern matching (#57637)
Jari Aalto
jari.aalto at cante.net
Sun Nov 26 18:24:28 GMT 2006
John Arbash Meinel <john at arbash-meinel.com> writes:
> My personal preference would be to support the following syntax:
>
> ? => Match any single character except '/' ie '[^/]'
> * => Match 0 or more characters except '/' ie '[^/]*'
> ** => Match 0 or more characters ie '.*'
> RE: => A prefix which lets you get as crazy as you want, except for
> group matches as mentioned by Jan.
>
> This isn't 100% compatible with shell, but shell is trying to do
> *inclusion*, while we are trying to do *exclusion*.
>
> So when do you 'ls *', you typically don't want to see dot files. But if
> you did "bzr ignore '*'" you typically *would* want to ignore dot files.
>
> It is slightly different than other syntaxes, but having to do:
>
> bzr ignore 'foo/*' 'foo/.*'
>From user perspective, while '**' sound good, I think it would be far
more intuitive to use constructs that are same as for shell. If every
time one has to remember what are the specialities of bzr patterns,
that becomes uncomforartable. You usually set ignores once and don't
touch them for a long time. When you come back you don't remmeber what
they mean, because they are not same as for shell.
This is more explicit:
foo/*' 'foo/.*
and tells to everyone, who comes from shell backgound, what it means.
That may look ugly, but it's immediately understod convention.
> 1) Forward compatible, except for '*' not matching '/', but it has
> already been decided that that was a bug, so we don't have to keep
> compatibility there.
>
> 2) Simple for users to understand. And I think this is key, if you
> really need complexity in your ignores, you can use RE: and go to town.
> But 99.9% of the time ignore patterns are simple. They can even be
> overly generic because if someone explicitly 'bzr add's a file, it
> becomes versioned.
Is this capital "RE:" or case-agnostic "re:"? The case-agnostic tag
would be best.
Jari
More information about the bazaar
mailing list