Have to remember to name initial branch when starting a local colocated branch

Bug #937123 reported by Jonathan Lange
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Triaged
Medium
Unassigned

Bug Description

This bug could also be characterized as "switch -b" doesn't actually create a new branch when the only branch is the default branch.

I almost always want to have a pristine local copy of the trunk branch of the project I'm working on, and I almost always want to call that branch 'trunk'. Whenever I start working on a project using colocated branches with Bazaar, I have to remember to do 'bzr switch -b trunk' as the first thing after I fetch the branch. Otherwise, I lose my pointer to the trunk branch.

e.g.

 $ bzr branch lp:foo
 $ bzr branches
 * (default)
 $ bzr switch -b fix-my-bug
 # hack hack hack
 $ bzr ci
 $ bzr branches
 * fix-my-bug

Oops! How do I get back to trunk?

Thanks,
jml

Jelmer Vernooij (jelmer)
Changed in bzr:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Thanks for the bug report.

I think we should probably automatically create a lightweight checkout of a new branch named "trunk" when somebody first uses a colocated branch somewhere.

Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 937123] Re: Have to remember to name initial branch when starting a local colocated branch

On 21 February 2012 06:33, Jelmer Vernooij <email address hidden> wrote:
> Thanks for the bug report.
>
> I think we should probably automatically create a lightweight checkout
> of a new branch named "trunk" when somebody first uses a colocated
> branch somewhere.

I agree, except I'm not sure 'trunk' is the best name, because it has
semantics about being the trunk of the project, and that may not be
true. Perhaps it should be 'default' or 'main'?

--
Martin

Revision history for this message
Jonathan Lange (jml) wrote :

On Mon, Feb 20, 2012 at 9:40 PM, Martin Pool <email address hidden> wrote:
> On 21 February 2012 06:33, Jelmer Vernooij <email address hidden> wrote:
>> Thanks for the bug report.
>>
>> I think we should probably automatically create a lightweight checkout
>> of a new branch named "trunk" when somebody first uses a colocated
>> branch somewhere.
>
> I agree, except I'm not sure 'trunk' is the best name, because it has
> semantics about being the trunk of the project, and that may not be
> true.  Perhaps it should be 'default' or 'main'?

Well, when branching from lp:foo, it's extremely likely to be true.

You could do something where the default name of the branch is the
last segment of the parent branch's URL.

jml

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

On 02/21/2012 12:04 PM, Jonathan Lange wrote:
> On Mon, Feb 20, 2012 at 9:40 PM, Martin Pool<email address hidden> wrote:
>> On 21 February 2012 06:33, Jelmer Vernooij<email address hidden> wrote:
>>> Thanks for the bug report.
>>>
>>> I think we should probably automatically create a lightweight checkout
>>> of a new branch named "trunk" when somebody first uses a colocated
>>> branch somewhere.
>> I agree, except I'm not sure 'trunk' is the best name, because it has
>> semantics about being the trunk of the project, and that may not be
>> true. Perhaps it should be 'default' or 'main'?
> Well, when branching from lp:foo, it's extremely likely to be true.
>
> You could do something where the default name of the branch is the
> last segment of the parent branch's URL.
>
The problem is that this isn't done until the first colocated branch is
created, so that sort of information is no longer available. Unless
perhaps we'd want to look at the parent branch, but that seems really
unobvious to me.

What about 'master' ? that would also be consistent with git.

Cheers,

Jelmer

Revision history for this message
Jonathan Lange (jml) wrote :

On Tue, Feb 21, 2012 at 11:15 AM, Jelmer Vernooij
<email address hidden> wrote:
> On 02/21/2012 12:04 PM, Jonathan Lange wrote:
>> On Mon, Feb 20, 2012 at 9:40 PM, Martin Pool<email address hidden>  wrote:
>>> On 21 February 2012 06:33, Jelmer Vernooij<email address hidden>  wrote:
>>>> Thanks for the bug report.
>>>>
>>>> I think we should probably automatically create a lightweight checkout
>>>> of a new branch named "trunk" when somebody first uses a colocated
>>>> branch somewhere.
>>> I agree, except I'm not sure 'trunk' is the best name, because it has
>>> semantics about being the trunk of the project, and that may not be
>>> true.  Perhaps it should be 'default' or 'main'?
>> Well, when branching from lp:foo, it's extremely likely to be true.
>>
>> You could do something where the default name of the branch is the
>> last segment of the parent branch's URL.
>>
> The problem is that this isn't done until the first colocated branch is
> created, so that sort of information is no longer available. Unless
> perhaps we'd want to look at the parent branch, but that seems really
> unobvious to me.

Why not create the first colocated branch when the branch is initially fetched?

> What about 'master' ? that would also be consistent with git.

That'd probably work too.

jml

Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.