views:

585

answers:

10

After a recent "accident" at work, whereby some bugs that previously had been fixed were reintroduced, I was asked to document a set of guidelines for the use of source code control (CVS in this case).

What do you consider to be best practices for using source code control? In particular, how do you manage branching and labelling and how do you ensure that the current production release can be patched while continuing to develop new features? For context, the team size is up to 10 developers in two locations.

+2  A: 

Eric Sink already put one together in his Source Control Howto.

Bill the Lizard
+5  A: 

8 Commandments of Source Control pretty much sums it up.

On the topic of branching and labeling what we do at work is:

Labeling

When ever an environmental release is done it is labeled with at the very least the date of the release. All (related) bugs are then set so that the "resolved in release" is this label.

Branching

Only created on an as-needed basis. A branch is done off a label so that a change can be done against a previously released version (ie, fixing a bug on production without including all other bug fixes)

Slace
+1 for the 8 commandments link. I'd never seen that before, but it's going on my wall. :)
Bill the Lizard
It's up here at work with a few additions so we have 10 now ;)
Slace
A: 

update as often as possible(depeding on the project growing speed) this way fixed files wont be able to be reintroduced. Intruct the developers to perforn an update before comiting.

Quamis
A: 

There are different kinds of workflows, you will have to consider which best meets your team needs.

Also I always recommend the SVN Book.

CMS
A: 

The book "Pragmatic Version Control (using Subversion)" is a really nice place to start. Even though its examples are specific to Subversion, it's a good intro to all the important concepts and practices.

Mark A Johnson
+1  A: 

I'm not sure that I would put "CVS" and "best practice" in the same sentence. There are many other, better, more modern choices for source control that are well-supported by the community.

Greg Hewgill
A: 

What timing! The upcoming StackOverflow podcast (guessing the URL here - won't work yet) is supposed to be about source control.

Eugene Katz
A: 

We try very, very hard not to branch. If we do create a branch it's a team decision and is carefully scrutinized. So I guess the practice would be "don't branch lightly".

Norman Ramsey
I have this same attitude - but I think it's caused by the fear of of using SourceSafe - which is notorious for bad branching. So how do you fix bugs in the production code while working on the new version?
A: 

Branching is a WONDERFUL thing.

Merging, however...no so much.

Will Hartung