Branching Best practices (looking for advices)

This forum is now locked, since Gold Support is no longer offered.

Moderator: SourceGear

Locked
Tri
Posts: 288
Joined: Wed Dec 22, 2004 11:10 am

Branching Best practices (looking for advices)

Post by Tri » Tue Aug 09, 2005 5:13 pm

Our Vault tree looks like this:

Code: Select all

MySolution
    Current
        Doc
        Code
We are planning on implementing branching to allow for the following:
We have a code freeze for a release.
We tag the tree.
We release the code freeze and the developers can continue to check in for the NEXT release.
Should it become necessary to make any fixes to this release we create a branch from the tag.
Q1: Is it possible to create a branch from a tag?

If we do create a branch we will merge in the changes from the branch to the main after the release goes out.

Q2: What do we do with the branch after the merge? Should we leave it around or delete it? Can we even delete it or would doing so remove the code? If we do delete it, what is the best way?

Q3: Should we create a branch for each release no matter if we use it or not?

The planned structure would be:

Code: Select all

MySolution
    Current
        Doc
        Code
    R1.0.X
        Code
    R1.0.Y
        Code
Q4: Is this good? Any issues with this?

Thank you in advance for any help.

kasti
Posts: 108
Joined: Tue Apr 20, 2004 4:21 am
Location: Austria

Post by kasti » Wed Aug 10, 2005 6:21 am

To throw in my 2cents worth:

We got a similar structure as you propose. What we do is we only branch on demand however. Meaning we label our releases and branch when we need to. The only time we do this is to create a Service pack of an older version. Sometimes our customers are not happy to update to the latest release but only want one bug fixed. Then we branch, fix the bug, and supply it to this customer. After that we keep this branch in vault since more service packs might follow.

BTW, you can delete a branch without any problems for you mainstream but I do not think it will give you any advantages unless you also obliterate (whereby you save space).

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: Branching Best practices (looking for advices)

Post by lbauer » Wed Aug 10, 2005 8:16 am

Tri wrote:Q1: Is it possible to create a branch from a tag?.
Yes, you can branch from a tag (label).
Q2: What do we do with the branch after the merge? Should we leave it around or delete it? Can we even delete it or would doing so remove the code? If we do delete it, what is the best way?
At SourceGear, we keep our branches in case we want to refer back to anything in the branch history. But this is a matter of your own preference. You could keep branches for a while, and delete and obliterate them later if you find you don't need them at all.

You might want to pin the branch so that it doesn't get modified and perhaps move the branch to another folder to keep it out of the way. Users can cloak the branch so they're not getting those files.
Q3: Should we create a branch for each release no matter if we use it or not?
No, I wouldn't recommend that. Unused branches would add unnecessary size and complexity to your tree. Be sure to label each release. You can always branch after the fact, from a label or folder version.
The planned structure would be:

Code: Select all

MySolution
    Current
        Doc
        Code
    R1.0.X
        Code
    R1.0.Y
        Code
Q4: Is this good? Any issues with this?
Here's a suggestion from our Knowledge base:

http://support.sourcegear.com/viewtopic.php?t=193

Also, Eric Sink has a good overview of branching in his blog:

http://www.ericsink.com/scm/scm_branches.html

Vault users -- if you have other comments or suggestions for Tri, please post.
Linda Bauer
SourceGear
Technical Support Manager

GregM
Posts: 485
Joined: Sat Mar 13, 2004 9:00 am

Post by GregM » Wed Aug 10, 2005 9:11 am

You can always branch after the fact, from a label
...as long as you haven't used label promotion with that label. Vault doesn't (yet) support branching from promoted labels.

christian
Posts: 202
Joined: Tue Sep 14, 2004 1:02 pm
Location: UK

Post by christian » Wed Aug 10, 2005 10:29 am

Just a preference we have here...

$/Mainline
MySolution
Doc
Code

We then have another "top level" folder in vault named $/Branches
Any time we need to do a branch of MySolution we branch to create the following tree in vault:

$/Branches
MySolution-R1.0
Doc
Code

We favour this becuase:
1) it clearly separates out work on release code from the folders on the Mainline (aka Trunk)
2) you can create a folder that aggregates multiple .net solutions. For example:

$/Branches
OurProductSuite-R1.0
MySolution-R1.0
Doc
Code
AnotherSolution-R1.1
Doc
Code

Christian

Tri
Posts: 288
Joined: Wed Dec 22, 2004 11:10 am

Re: Branching Best practices (looking for advices)

Post by Tri » Wed Aug 10, 2005 1:04 pm

Thank you very much for your detailed help. Also thanks to all Vault users for your advices.
lbauer wrote:
Tri wrote:Q1: Is it possible to create a branch from a tag?.
Yes, you can branch from a tag (label).
Can you please indicate briefly the procedure?

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Post by lbauer » Wed Aug 10, 2005 1:43 pm

Assuming a folder has been labeled at some point:

Right click on the folder and select Show Labels. In the Labels dialog, right click on the appropriate label and select Branch.
Linda Bauer
SourceGear
Technical Support Manager

Locked