Help promoting Bazaar

Ben Finney ben+bazaar at
Thu Jul 15 11:21:19 BST 2010

Daniel Carrera <dcarrera at> writes:

> 1. How do you interactively select changes to commit, in the style of
> "darcs record", "hg record" and "git add --patch"?

It seems quite backward, to me, that one would want to commit an
untested subset of the changes in the working tree. Unlike those
systems, Bazaar encourages getting the working tree into a state fit for
committing, so that it can be tested *as is* before the commit.

So, the ‘bzr shelve’ command (built into later versions of Bazaar,
though you will find online references to an older plugin) is what you
want. You put aside (temporarily revert) the changes you *don't* want to
commit yet, getting the working tree to the point where the only changes
left are those you want right now.

Then you test; then, if the tests pass, you ‘bzr commit’.

After committing, bring the shelved changes back into the working tree
with ‘bzr unshelve’, and keep on hacking.

> 2. Does "bzr branch Foo" do something similar to what it does in
> Mercurial and Git? i.e. make a new branch in the current repository,
> so you can switch between them with something like "bzr update" or
> "bzr checkout"?

No. Bazaar by default uses the filesystem to distinguish branches; each
branch occupies a separate directory with its own working tree (if any).
The gack that a bunch of branches are subdirectories of a repository is
what causes them to be “in” that repository.

I believe there is a plug-in to make multiple branches within a single
directory, like the Mercurial and Git model. I know that pipelines offer
a similar workflow, allowing me to switch between each one without
leaving the directory.

> Btw, what's the difference between "update" and "checkout"?.

I'm not sure why you'd think they are to be confused; perhaps you're
thinking of some other pair of commands?

‘bzr update’ updates the state of the working tree from the repository:
it modifies the files in the working tree so that all the revisions from
the repository are applied.

(Hmm, the help for update doesn't really make that very clear. It jumps
straight into talking about a merge, which doesn't get the basic point
across very well IMO.)

‘bzr checkout’ makes a new checkout of an existing branch. You might
find ‘bzr help checkouts’ useful.

> 3. If you are using Bzr-Git, can you just do "bzr dpush" without any
> other arguments? Btw, what's the difference between "push" and
> "dpush"?

I have no idea what ‘dpush’ is supposed to mean; every time it's
explained to me I don't see why that name was chosen, and I forget the
association. I think of it as “destructive push” because it discards
existing history (fails to propagate the actual history), which makes it
less reliable than ‘push’. Perhaps someone who actually uses it can
describe its purpose better.

 \            “There was a point to this story, but it has temporarily |
  `\                    escaped the chronicler's mind.” —Douglas Adams |
_o__)                                                                  |
Ben Finney

More information about the bazaar mailing list