new status output

Martin Pool martinpool at gmail.com
Wed Oct 26 02:03:14 BST 2005


On 25/10/05, James Blackwell <jblack at merconline.com> wrote:

> I respectfully request that we not refer to using xargs in any of the
> documentation. xargs is notoriously bad at getting tricked by bad
> filenames.

A good point.  But the problem is not exactly xargs, but rather shell
scripting in general.  One would have similar trouble with

  for i in `bzr unknowns`

or

  rm `bzr unknowns`

One thing we can do is avoid requiring users to write or use shell
scripts.  There are several reasons: it won't work for most Windows
users, some users are uncomfortable writing or debugging them, and
they tend to do badly on strange filenames.  So automatically adding
all unignored files is an example of avoiding something that might
need shell scripting.  Having builtin things to list ignored files
avoids the need to use awk to extract them from svn-style status
output.  One can also write plugins like bzrtools' clean-tree that do
everything in Python and so avoid cross-platform and quoting problems.

However, shell scripts are pretty useful for some users, and we can
support them.  So we could have 'bzr ls --unknown --null' to produce
output for 'xargs -0', and I think the default output tries to quote
strange filenames in a way that will work for shells.  (We are a bit
constrained because of not being able to use \ as a quote character,
and so it probably doesn't handle every case properly at the moment. 
But it handles the typical ones like having space in filenames.)  I'd
rather not have the default quoting be os-specific if we can avoid it.

--
Martin




More information about the bazaar mailing list