Bazaar still below the radar when evaluating VCS tools

Stephen J. Turnbull stephen at xemacs.org
Sat Feb 27 16:55:42 GMT 2010


Robert Collins writes:
 > On Sat, 2010-02-27 at 17:08 +0900, Stephen J. Turnbull wrote:

 > > I want two commits coalesced, ie, the record of the earlier
 > > commit removed, but not the content.
 > 
 > One way [manual, automatable]: given commits 1, 2, 3, 4, 'hide' 2:
 > 
 > bzr branch r 1 source tmp
 > cd tmp
 > bzr merge -r 3 $source; bzr commit -m message-of-three
 > bzr merge $source; commit -m message-of-four
 > bzr push $source

D'oh.  Yes, that's a better idea.  I think what *I*[1] actually want,
though, is

    bzr branch r 1 source tmp
    cd tmp
    bzr merge -r 3 $source; bzr commit -m message-of-three
    bzr merge $source; bzr revert --forget-merges; 
    bzr commit -m message-of-four
    rm -rf $source

as I probably wouldn't do this on a published branch, only on a
feature branch that hasn't yet escaped to the outside world.  Ie, I
want the log -n0 to show

    orig4
    message3
      orig3
      orig2
    orig1

This does involve actually patching up for each version, though,
right?  It would be nice if it could be done purely as a metadata
manipulation without touching the workspace, as git filter-branch
does.[1]

Also, suppose I don't want to hide commit 2, but rather change it,
*without* changing the content of any descendents.  Eg, commit 2
doesn't build for some stupid, trivally correctable reason.  I guess
something like

    bzr branch -r 1 source tmp
    cd tmp
    bzr merge -r 2 $source; bzr revert --forget-merges
    # edit as needed
    bzr commit -m message2+fixup
    bzr revert -r 1
    bzr merge --force -r 1..3 $source
    bzr commit -m message3
    bzr merge -r 3..4 $source
    bzr revert --forget-merges    # optional
    bzr commit -m message4

is the best that can be done?[1]  Seems kinda complicated.

Footnotes: 
[1]  I don't know if use cases for this kind of thing would show up in
the work of Real People[tm], but in my git projects I do it fairly
frequently.





More information about the bazaar mailing list