why does bazaar not add a file automatically on the first commit

Matt Nordhoff mnordhoff at mattnordhoff.com
Tue Apr 22 21:40:00 BST 2008


Rahul Nabar wrote:
> I find myself repeating this cycle so often that I wonder there isn't
> a combined command / option.
> 
> #made a new file foo.cfg
> bzr commit ~/foo.cfg
> bzr: ERROR: Path(s) are not versioned: ~/foo.cfg
> bzr add ~/foo.cfg
> bzr commit ~/foo.cfg
> 
> If a user requests a commit and the file is not being tracked why
> doesn't bazaar automatically add it  rather than complain? If the user
> demanded a commit it is reasonable to assume he wants that file added?
> Perhaps with some option --force etc. Is that a feature  / bug? Maybe
> there's some subtlety I am not aware of! Just curious!
> 
> I must mention that I've a .bzrignore set to * since I'm using it to
> version scattered scripts and config files across my system.

FWIW, hg has a -A/--addremove argument to commit. (It also has an
addremove command.)

Automatically adding files when they are specified on the command line
is a neat idea though. Except, you could do "bzr commit *" or something
and accidentally add files you don't want. There could be a heuristic to
 not add files when a ton of them are specified, or the entire
directory, or something.
-- 



More information about the bazaar mailing list