Are squashed commits and discarded branches possible in bzr?

Todd A. Jacobs nospam at codegnome.org
Mon May 10 20:08:44 BST 2010


On Mon, May 10, 2010 at 12:24:08AM +0200, Jelmer Vernooij wrote:

> $ bzr merge ../feature-branch
> $ bzr revert --forget-merges
> $ bzr commit -m "New commit message for squashed commit"
> 
> Does that address your use case?

Mostly, although now that I know where to look in the docs, I'm
concerned about the warning that says:

    Because this technique forgets where these changes originated, it
    may cause additional conflicts on later merges involving the same
    source and target branches.

This has never been a problem for me in git, and may never be a problem
for me in bzr, but I'm trying to understand *why* the help says this is
dangerous.

It would seem to me that the problem here is that, unlike git, "revert
--forget-merges" simply applies a single patch without referencing a
common ancestor. As a purely practical matter, I could probably work
around this by simply re-merging from a given (later?) revision on the
feature branch rather than re-merging the whole branch, but I haven't
had the opportunity to try this out yet, so I'm not sure under what
circumstances the whole thing will break (or succeed, for that matter).

If squashed commits aren't first-class merges in bazaar, is there
perhaps a different way to go about it? Some sort of history rewriting,
for example?

Really, the desired end result is to discard the incremental (and often
irrelevant) steps in building a feature up in a topic branch, so that
the history in the trunk only reflects significant changes to features.

I appreciate you pointing me in the right direction. There still seems
to be something not quite right in my conception of the workflow,
though.

-- 
"Oh, look: rocks!"
	-- Doctor Who, "Destiny of the Daleks"




More information about the bazaar mailing list