Are squashed commits and discarded branches possible in bzr?
Eric Siegerman
lists08-bzr at davor.org
Mon May 10 00:31:15 BST 2010
On Sun, 2010-05-09 at 15:18 -0700, Todd A. Jacobs wrote:
> [Can I, as in git,] make incremental commits while trying out an idea,
> and then later merge the changes into mainline with a squashed or
edited
> commit,
To squash a commit, use "bzr revert --forget-merges", as Jelmer
said in another post.
To edit a commit, see the bzr-rewrite plugin, which supposedly
does something similar to git's "rebase" facility.
> or simply purge a failed branch from the repository altogether.
Just delete the branch's file-system directory. If it's a
standalone branch (i.e. if it's *not* using a shared repository),
the revision history is stored within the branch's .bzr
directory, so "rm -r"ing the whole branch will delete that too.
But if the branch *is* using a shared repository, read on.
> Technically, those commits hang around in the git reflog until purged,
> but they aren't cluttering up the actual view of history.
In the shared-repository case, Bazaar is similar. The revisions
hang around in the shared repo, but no branch references them, so
they're not visible in any branch's history.
Should you ever need to track down such a "dead" branch, see the
"heads" command that's provided by the bzrtools plugin.
Not sure about garbage collection. That never used to happen --
dead branches would simply hang around forever. I have a wisp of
a notion, though, that someone might recently have implemented a
garbage collector (as part of a plugin perhaps?). But this is a
vague half-memory, and/or based on my misunderstanding, and so
may well be wrong.
- Eric
More information about the bazaar
mailing list