remove vs rm vs forget (was [MERGE] remove --new)

John Arbash Meinel john at arbash-meinel.com
Fri Jun 16 17:33:34 BST 2006


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

Matthew D. Fuller wrote:
> On Fri, Jun 16, 2006 at 10:14:29AM -0500 I heard the voice of
> John Arbash Meinel, and lo! it spake thus:
>> I really don't like CVS's model. Especially since the way to revert
>> a file is to 'rm foo; cvs update foo'. Really really ugly.
> 
> The worst is that the files are gone after the first command, so the
> second command gets harder.  i.e., "rm *.gif ; cvs rm *.gif" sure
> doesn't do much useful.  And to unversion a file you want to keep
> around requires even worse contortions.
> 
> On the one hand, the inconsistency (bzr mv mv's, but bzr rm doesn't
> rm, in the working tree) kinda bugs me.  On the other, though, mv
> doesn't lose you anything, while rm can, so I like a little more
> caution there.  I'd be all in favor of `bzr rm --delete`, though.
> 
> 

For consistency, I would tend to make 'bzr rm' delete the file, and 'bzr
unversion' or 'bzr rm --no-delete' do the other.

We've probably discussed this to death, and we just need to make a
decision. Everybody isn't going to be happy, no matter what route we
take. So we should pick one, and just go for it.

We can be conservative with 'bzr rm --delete', slightly less with 'bzr
rm' saving a backup file. And even less with 'bzr rm --no-delete'.

I don't know what people typically do. I realize you can mistype and
accidentally delete the wrong thing. So my favorite is to go with:

bzr rm # Creates a backup file, even better if only created if file was
       # modified
bzr rm --no-delete # Doesn't touch the working file
bzr rm --delete # Does the same as plain bzr rm, but exists for
		# consistency.

I think this makes it nice to use. And you'll never lose anything. If
the file is identical to the base inventory, you can just 'bzr revert'
it to get it back. If it is different, there is a backup file that you
can restore.

And if you want the "I used to version this file, but I've decided I
don't want to anymore, but I still need the file in that location" you
can use the --no-delete flag.

I would survive if 'bzr rm' doesn't actually delete the file. But since
I'm likely to alias it with rm = rm --delete, I would really want the
'--no-delete' flag, and for it to save a backup.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEkt1eJdeBCYSNAAMRAnx7AJ96xUO2mz9Z2VxZdTFQs67qLdVROACgkK/J
geX89JFngW++Ic6ZUpX0EVQ=
=0ktS
-----END PGP SIGNATURE-----




More information about the bazaar mailing list