bzr add

Michael Ellerman michael at
Wed Aug 24 07:48:27 BST 2005

On Wed, 24 Aug 2005 15:44, Robey Pointer wrote:
> On 23 Aug 2005, at 17:00, Johan Rydberg wrote:
> > Hash: SHA1
> >
> > Robey Pointer <robey at> writes:
> >> It looks like "bzr add <folder>" adds not just the folder, but
> >> everything in it.  But sometimes I only want to add *some* things in
> >> the folder (for example, not .pyc files).  bzr is giving an error on
> >> attempts to do these partial adds:
> >
> > I suggest you look at "bzr add --help" and specially for the
> > - --no-recurse option.
> Well, that's surprising enough. :)
> The default behavior for commands (ie, the behavior with no options)
> should be the simplest or least surprising.
> The attached patch fixes "add" to default to non-recursive, using -R
> or --recurse to get recursive behavior, and fixes the tests to
> follow.  It also gets rid of a double negative. :)

I think that's really bad UI. I wrote about it before, but Google can't seem 
to find it, so here from my sent-mail:

I don't see the point of non-recursive mode.

If you think about it, you don't care about versioning directories, you care 
about the files in them. You would never add a directory and then not add a 
file in it later (usually straight away).

Other SCMs make you do this stupid dance:

# scm add subdir/bar/foo.file
ERROR: subdir/bar is not versioned!
# scm add subdir/bar
ERROR: subdir is not versioned
# scm add subdir
A       subdir
# scm add subdir/bar
A       subdir/bar
# scm add subdir/bar/foo.file
A       subdir/bar/foo.file

bzr's smart enough (well it will be [1]) to work out that if you're asking to 
add a file then you implicitly want its parents to be versioned too.

So you just get:

# bzr add subdir/bar/foo.file -v
A       subdir
A       subdir/bar
A       subdir/bar/foo.file

And so you never need to call 'bzr add directory' directly. Which means if you 
*do* run 'bzr add directory' the only useful thing for it to mean is 'add 
that directory and all the files under it'.

[1] Seems this hasn't quite got implemented yet

Michael Ellerman
IBM OzLabs

phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : 

More information about the bazaar mailing list