[RFC] Improvements to is_ignored.

Jan Hudec bulb at ucw.cz
Wed Feb 1 09:21:30 GMT 2006


On Wed, Feb 01, 2006 at 03:58:06 -0500, James Blackwell wrote:
> On Fri, Jan 20, 2006 at 04:21:17PM +0100, Jan Hudec 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.
> 
> I tried ls "**" and "ls ***" on my system here and couldn't tell any
> difference from "ls *". I also don't seem to know how to work "RE:". I use
> bash, which isn't an uncommon shell.

Bash does not support recursive globs at all. At least I don't know
about it. Zsh does. In zsh, **/ expands to any path (whole components only)
and ***/ does the same plus it follows symlinks. We do not have a use
for following symlinks, but we do have a use for including entries
starting with ., so that's what I used it for that. In zsh, you would do
that with /(.#*/)# (because **/ is defined as (*/)# there), but I didn't
want to add (, ) and # until I understand how to do /expansion/ of it
(matching would be trivial -- '(' -> '(?:', ')' -> ')' and '#' -> '*').
Because it's supposed that the same globs will be used for expansion on
Windows.

> I don't think thats necessarily a bad idea -- in fact, somebody already
> mentioned the tutorial, though I would like for us to consider the unlikely 
> possibility that somebody would gloss over documentation.
> 
> However, later in your post you mention possibly having to do this
> expansion within Bazaar-NG itself for windows. If that's the case for
> cmd.exe, then isn't it the case as well for bash?

On Windows, shell (cmd.exe) does NOT expand globs. It's the
responsibility of each application to do it. Yes, bzr would probably be
the only windows application supporting recursive globs then, but I
think they are useful.

On a side-note, command-line glob expansion will NOT support RE: even if
ignores and other uses will, because I don't know to do expansion on
full regexes.

> If your meaning is include support for patterns that come from ZSH and are
> rarely supported elsewhere, then that's more of a problem. I think its
> so-so to allow something that most platforms support (e.g. symlinks)  and not
> a good idea ("/" as a filename character) when most platforms don't.
> 
> I'm particularly interested in this hypothetical question: If Martin used
> zsh (he may), adds a "RE:..." pattern to the bzr tree, will I be still be
> able to work safely without changing shells?

On unix, globs are expanded by the shell. So it's your shell that
chooses how they are expanded. So this will only affect ignore lists and
configuration (the sections names are globs, which will use the same
semantics).

The glob->regexp translation engine is quite flexible, so if we decide
on a different semantics than what it currently implements, it will be
relatively simple to switch to it.

-- 
						 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/20060201/35d2d639/attachment.pgp 


More information about the bazaar mailing list