recursive commands?

Michael B. Trausch mbt at zest.trausch.us
Wed Aug 5 14:41:10 BST 2009


On Wed, 5 Aug 2009, knubee wrote:

>> either edit .bzrignore or quote the pattern in the command
>
> i spoke too soon. this works for some things, but if the files are already
> versioned, bzr says:
>
> Warning: the following files are version controlled and match your
> ignore pattern:
>
> [snip]
>
> These files will continue to be version controlled unless you 'bzr remove' them.
>
> but if i try to remove them (using quoted pattern), i get the following:
>
> > bzr remove --keep '*.log'
>
>   *.log is not versioned.
>
> > bzr remove '*.log'
>
>   *.log does not exist.
>
> any suggestions?

When adding to the ignore specification, you need to protect the wildcards 
from the shell, so that globbing does not take place.  That way, bzr can 
evaluate the wildcarded expression later on.

However, when working with files on the file system (as you are doing with 
'bzr remove'), you want the shell to do its thing and replace the 
wildcards, so you do not want to quote.

This is a general thing which Linux, BSD, etc., have inherited from the 
design of original UNIX systems.  This differs from DOS and Windows in 
that DOS and Windows never perform globbing on the command line, thus 
leaving that duty to the program.

So, in essence, when you want to have bzr *see* "*.o", you need to protect 
the * character from expansion by the shell.  When you want bzr to see a 
list of files to perform an action on, in the here-and-now, you should NOT 
protect the * (or any other wildcards or regular expressions) from 
expansion, because you're acting on a finite, exact list of files.

In this case, it may help to be more intimately familiar with your shell. 
It may help to read these, which provide an overview of UNIX shell 
globbing:

  http://www.mpi-inf.mpg.de/~uwe/lehre/unixffb/quoting-guide.html#sect:shell-quot
  http://www.faqs.org/docs/abs/HTML/globbingref.html

 	--- Mike



More information about the bazaar mailing list