Which VCSes have "uncommit"?

John Arbash Meinel john at arbash-meinel.com
Thu Nov 5 17:17:18 GMT 2009


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

Neil Martinsen-Burrell wrote:
> On 2009-11-05 09:41 , Daniel Carrera wrote:
>> Does anyone know which distributed VCSes have an "uncommit" feature at
>> least as powerful and at least as easy as the one from Bazaar? The only
>> examples I know are Bazaar and Darcs ("darcs unrecord").
>>
>> I get the impression that Mercurial and Git can use "rebase" to achieve
>> this, but that this is more complicated. So they would meet the "at
>> least as powerful" criterion but not the "at least as easy" criterion.
> 
> As far as I know, every dVCS can do this operation because it is a
> simple operation on the DAG: change the tip pointer to point to the
> parent of the current revision.  This is in fact what ``bzr uncommit``
> does.  If you want to get particularly explicit with this, you can
> uncommit as many revisions as you want using ``bzr pull . --overwrite -r
> -N`` (which I've had to do recently after accidentally pulling from
> trunk while in a release branch).  A bit of googling shows that
> equivalents are ``git reset --hard HEAD~N`` or ``hg rollback`` (for a
> single revision).
> 
> -Neil
> 
> 

The main difference between "bzr pull . --overwrite" and "bzr uncommit"
is that 'uncommit' leaves the working tree alone (assuming you want to
do something with the previously committed changes, like a cleanup +
commit.)

'bzr pull . --overwrite' is more "bzr uncommit && bzr revert".

John
=:->

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

iEYEARECAAYFAkrzCJ4ACgkQJdeBCYSNAANt/ACg2an0r4vZ/WTUP89DuTMz5W3l
6aoAoJ8wjx8/Eym2LdiIOtmcl14AkHN3
=WuNq
-----END PGP SIGNATURE-----



More information about the bazaar mailing list