[RFC] branch --bind

Martin Pool mbp at canonical.com
Thu Jan 7 01:20:46 GMT 2010


2010/1/7 John Arbash Meinel <john at arbash-meinel.com>:

> So *IMO* an optimal setup would be to get rid of heavyweight checkout as
> a concept. And stick with
>
> Repository
> Branch
> Checkout
>
> And then if you want the "heavyweight" behavior, you use a local
> checkout of a local branch which is bound to a "remote" branch. If you
> want to commit locally, then you create a new local branch (no new
> tree), point your local checkout into it and commit. (no commit --local.)
>
> That makes it quite a bit clearer what state your bound branch is
> supposed to be in. When you get back online, you can point your checkout
> back and the bound branch and "bzr pull" the local branch's changes back
> into your bound branch, which will also update the network branch. (or
> you could push the local changes into the network branch, switch and
> then update, etc.).
>
> commit --local (IMO) is a misfeature, as it lets you take something that
> claims to be in-sync and explicitly get it out-of-sync-for-right-now. It
> should be cheap to just create a 'this-one-is-not-in-sync' branch
> instead.

I agree with all this.

> And possibly 'unbind' would also allow you to do that without a
> physically separate branch.

Yes, unbind makes it clear that you're switching between two standard
modes "bound" and "separate branch", whereas commit --local puts you
into a third and imo unnecessary mode of "bound but diverged."

It's still going to be possible to get into 'bound but diverged' when
for example someone does a non-appending operation on the master, but
that's not something we should encourage or that people would commonly
hit.

-- 
Martin <http://launchpad.net/~mbp/>



More information about the bazaar mailing list