Alternate glob matcher for .bzrignore

Jan Hudec bulb at ucw.cz
Mon Jan 9 07:39:32 GMT 2006


On Sun, Jan 08, 2006 at 17:37:30 -0600, John Arbash Meinel wrote:
> Martin Pool wrote:
> > On Mon, 2006-01-09 at 10:21 +1100, Robert Collins wrote:
> > 
> > 
> >>Do we really want to handle directories differently? Last time that came
> >>up I recall a solid trouncing in my direction for using '/' like that -
> >>like rsync does.
> > 
> > 
> > Good question.
> > 
> > I think the objections before were not so much that they handled
> > directories differently, but rather than using '/' to indicate
> > 'everything within' both quite subtle, and has few or no precedents in
> > unix *and* is different to the one tool, rsync, that does use it.
> > 
> > The fact that * matches only single directory components is pretty well
> > established in Unix, and having ** match any number of whole directory
> > components is moderately well established.  
> > 
> > It may be a bit surprising that '**.tmp' doesn't match .tmp within
> > directories, and you need '**/*.tmp'.  
> > 
> 
> Is that how zsh does it? That wasn't how I implemented it.
> **.tmp matches .tmp in the directory. (It translates to regex .*)

Well, shell needs to process the pattern split into components. And zsh
only treats ** specially if it is a whole component. So given file
foo/bar/baz/qyzzy, it is generated by **, **/qyzzy, foo/**/qyzzy and
foo/**, but NOT **y, NOR f**/qyzzy! 

It is by the way matched (as in case or zsh builtin [[]] test) by all of
them, because matching does not consider / special.

-- 
						 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/20060109/902e6326/attachment.pgp 


More information about the bazaar mailing list