[RFC] Improvements to is_ignored.
Jan Hudec
bulb at ucw.cz
Sat Jan 21 07:55:41 GMT 2006
On Sat, Jan 21, 2006 at 10:57:24 +1100, Martin Pool wrote:
> On 20 Jan 2006, Jan Hudec <bulb at ucw.cz> wrote:
> > * New glob->regex convertor that more closely follows shell semantics.
> > It has * and ? not matching .-files, **/ matching any number of path
> > components (zsh-style - whole components only!) and ***/ that also
> > matches .-dirs, named character groups ([[:alnum:]], [[:digit:]],
> > [[:space::]] are unicode-aware) and RE:regexp.
>
> There was some discussion last time about whether ** should match only
> whole components, or any substring. The zsh form seems a bit more
> precise. Does anyone have an opinion?
>
> I don't expect it will be used very often in ignore patterns; it's
> probably more likely in the branch configuration, where we might have
>
> [/home/mbp/**/bzr.mbp.*]
>
> and even in that case it makes no difference which meaning we use.
It makes difference for one thing. If it only matches whole components, we
can split on '/' and then match the individual patterns to individual
components. While when ** matches any string, this becomes complicated. It is
also a reason I decided not to add zsh-style () and # - they would complicate
this a lot.
> > * The .bzrignore file is read in utf-8. If decoding fails, it is not used.
>
> I'd like at least a warning to be shown if it can't be decoded, rather
> than just being unused.
Yes, it does issue a warning.
> [...]
>
> > Other things to consider:
> >
> > * Do we actually want to use the semantics that * and ? don't match . at the
> > begining of a path component? It is closer to what people expect, since
> > it is what shell does. However semantics is more useful.
>
> (I don't understand that last sentence.)
'which' fell out.
> I think being consistent with the shell is best. The only drawback is
> that it may confuse windows users who are not familiar with that aspect
> of unix globs, but they're less likely to have dot files anyhow.
>
> > * Do we want to use the new globs for finding per-branch sections in
> > ~/.bazaar/bazaar.conf? Probably yes I think. This will be user-visible
> > change.
>
> Yes, I think so.
Ok.
> > * Do we want to use the new glob semantics for expanding command-line
> > arguments on Windows? I think I can do that (with exception of the RE:
> > 'pseudo'-globs) relatively easily.
>
> That would be good. I'd like sometime to do this more systematically by
> defining which arguments should be glob-expandd, rather than doing it
> inside the run method.
Yes, that would be good too.
Um, I just realized that I have to fix this anyway, because the module is
called glob, which conflicts with top-level glob and python can't load the
global module in such cases :-(.
--
Jan 'Bulb' Hudec <bulb at ucw.cz>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060121/5fb61825/attachment.pgp
More information about the bazaar
mailing list