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

John Arbash Meinel john at arbash-meinel.com
Tue Apr 22 22:24:00 BST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Matt Nordhoff wrote:
| 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.

True, but heuristics often get you into trouble. (No, I really do want to add
all the files in that directory, oops I added *.c instead of just foo.c, etc)

Also, if you specify a containing directory, should it add the things
underneath? (bzr commit library)

Which is where just having the user supply a flag really eliminates the guesswork.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkgOV3AACgkQJdeBCYSNAAPlmQCgk1n8fJOOcw5p/F3ZMMX/Jx+t
PSgAoI2wtbBlSfbb+vmv7nbuLqpxF7Jb
=9t5D
-----END PGP SIGNATURE-----



More information about the bazaar mailing list