tags:

views:

46

answers:

2

I have a project for which I am ready to create a branch, which will be branch 1.0.x for all of the 1.0.x changes. I also want to have a set of tags to correspond to changes to that branch, i.e. 1.0.1, 1.0.2, etc. When I first create this 1.0.x branch, I am also creating a tag named 1.0. At this point, the branch and the tag have the same contents (as I make changes to the 1.0.x branch, I will create new tags for 1.0.1, 1.0.2, as I mentioned above). It seems like there is a bit of duplication with the way svn stores branches and tags. Is this a good practice for creating the branches and tags? Or is there a better way to do this?

thanks, Jeff

A: 

svn really doesn't care how projects are stored, the truck, tag, branch layout is just a suggestion. It seems like you are going to be using your branch for main line development, and then tagging the branch to deploy as a version. To me, it looks like you are using branched in what traditionally is done in trunk. Here's a pretty standard development cycle:

build new features -> stop new features, stabilize trunk -> tag version -> build new features in trunk (repeat)

Then, if you need to fix any bugs in tag, make sure to port them to trunk.

This is oversimplified, but is a good starting point.

karlw
@karlw, please see my comment to @Michael Shimmins' post. I am branching because I might need to be doing parallel development on various versions, i.e. making a fix on 1.0 which will become 1.0.1, and also continuing development on version 1.1 separately (and merging the changes from the 1.0.x branch to 1.1).
Jeff Storey
+1  A: 

It seems like there is a bit of duplication with the way svn stores branches and tags

Branching and tagging are the same in SVN.

It sounds like you're branching the branch for each minor version within the major version's branch. Basically a feature branch within a version branch.

If you're making changes in the tag, I would branch not tag to keep it consistent. If you're tagging the branch to keep marker points of minor versions for future reference (ie: being able to get a snapshot of the code used to build 1.2.7 for instance) then tags are correct.

I generally tag off the trunk (assuming you're using the trunk as the 'stable branch'). I branch off the trunk for version/features, and once complete and having passed QA, I merge those branches back into the trunk. I then tag the trung to label it as the code used to build a version. I then delete the feature branch as it has been merged back into the trunk.

There is nothing wrong with branching branches, it can go as deep as you want, although merging may get (conceptually) harder.

Michael Shimmins
@Michael, thanks for your answer. To add some more info, one of the things I'm concerned about is what if version 1.0 is deployed to our customer and we've started 1.1. The customer then needs a patch for 1.0, which becomes 1.0.1, but the features in 1.1 are not yet ready for the customer. Now I can modify that 1.0.x branch and create 1.0.1 without giving out the 1.1 version, which is why I was thinking of branching, even for minor versions. But the point I create version 1.0.1, would it then make sense to tag that for reference (assuming my branching/tagging scheme makes sense)?
Jeff Storey
Yep - you could branch the 1.0 tag as 1.0.1 branch, make your changes, commit them back in and merge it into the stable trunk. You'd then tag the stable trunk again as 1.0.1 containing only the 1.0 + 1.0.1 changes. The 1.1 branch hasn't been merged into the trunk yet so its still isolated from release. You can merge the trunk up to the 1.1 branch after merging the tag down into it, so that your 1.0.1 patch changes are incorporated in the latest 1.1 development build.
Michael Shimmins