views:

270

answers:

4

I'm duty-bound by policy to use CVS in this certain project, so even though I'd really to switch to something else, like Git, I cannot.

So, my real question goes like this: We have a convention that we create a new branch in CVS every time we make a release (we also tag, but that is besides the point). We call these version-branches, and they allow us to easily check out a specific version and make hot-fix changes to it - this is what our minor-releases are.

But now I have some large-ish, risk-ridden changes coming up and if I was working in Git, I'd be creating a feature-branch in the blink of an eye. However, working in CVS, I tried creating feature branches in another project and found that things quickly turned out messy. I ended up with lots of branches and I lost track of which branches were synched, which needed merging and which were no longer in use.

So, inching closer to the question mark, is it feasible to use feature-branches in CVS? Are they too much trouble to be worth it or will I eventually end up being sorry for not using them? Should I bite the bullet and just start coding in HEAD but bend my cpding process to introduce the changes in the most unobtrusive way possible?

+1  A: 

One thing to consider is to actually close the feature-branch when you are done with it, once you have merged it back with the main trunk. In this context, close simply means abandon the branch, not a real deletion.

Once the work is merged, there really is no need for the branch to "exist".

In order to quickly identify what branches are feature branch, I would suggest having a naming convention leak "FEAT_MY_FEATURE" or "FEAT_20080926" (start date?). This would make it easy to disregard all those feature branches when browsing the repository structure.

Benoit
What is this "closing" thing you speak of? I think there's a way to delete branches, but closing branches is not something I have heard of before. Googling is suggests it might be convention based: http://www.x.org/wiki/CvsBranchnames
Christian Vest Hansen
All I mean by closing is "stop using them/forget about them" Once the merge occurs, abandon the branch
Benoit
+3  A: 

If you are the only one developing on the feature-branch, you could simply use Git as your "sandbox development" system and then once you have the changes done, merge them into your CVS repository.

You still gain the benefit of source control for your intermediate work product.

Benoit
I accepted this answer because this is the way I've decided to go about it.
Christian Vest Hansen
+2  A: 

There is an excellent discussion of branching strategies called streamed lines which might help - it describes the advantages and disadvantages of using feature branches.

It also covers options for code line owenership and policies that you might like to implement

Richard
There's a lot to read. And the document is old. But yeah, I'll take a good look at it.
Christian Vest Hansen
+1  A: 

I have worked in an environment for several years where this was common practice and it was really painful. Make sure that the merges are part of your project plan because they are going to consume a lot of time and are sources of delay.

Documenting the branches and assigning them specific responsibilities helped a little.

We had to create a tool to help us merge changes incrementally (one change at a time, instead of merging the tip of branches) because CVS does not behave well if the two branches diverge.

Often synchronize (at least once a week).

I think the best way to approach this in retrospect would be to make sure that divergence remains minimal and splitting the risky development in different milestones by using Scrum for example.

I also encourage you to read SCM Patterns. This books contains a lot of good advices.

David Segonds
To clarify: you worked in an environment where the use of feature branches in CVS was common practice, right?
Christian Vest Hansen
This is correct.
David Segonds