bzr add and recurse
Michael Ellerman
michael at ellerman.id.au
Sun May 29 15:44:12 BST 2005
On Sun, 29 May 2005 21:42, William Dodé wrote:
> Now ``bzr add`` has recurse=True by default, i would prefer False by
> default, but anyway, it's not possible to choose even if the function has
> already this possibility.
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'.
> What should be the option to don't recurse ? The patch will be
> trivial to do...
Well if you really want to, I guess I'd call it --stupid-behaviour. No just
kidding! How about --no-recurse?
[1] Seems this hasn't quite got implemented yet, the attached patch fixes
that.
cheers
--
Michael Ellerman
IBM OzLabs
email: michael:ellerman.id.au
inmsg: mpe:jabber.org
wwweb: http://michael.ellerman.id.au
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: add-adds-parent.patch
Type: text/x-diff
Size: 2152 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050530/bbf6984b/attachment.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050530/bbf6984b/attachment.pgp
More information about the bazaar
mailing list