11

i'm going to be responsible for deciding how tagging branching is going to happen in our CVS/SVN repo.

Is there any literature that will help me understand the best way to work with CVS? either branching/tagging, etc?

thanks

0

13 Answers 13

22

My personal experience during more than 10 years of CVS at the FreeBSD project is: switch to something else as fast as you can. CVS is file oriented not snapshot/changeset oriented which makes merging beween branches rather painful. Branches are painful with CVS anyway.

As for resources for CVS see CVS Home

If you want to talk about SVN, I'd suggest the SVN Book itself and this question.

3
  • I only used CVS for a couple of years, but I quicky formed the same opinion. When starting from scratch we used SVN and found it, while not perfect, still vastly preferable. Jan 21, 2009 at 15:48
  • 2
    The biggest problem I have with CVS is that commits aren't guaranteed to be atomic. Much hilarity ensues. Just use a modern VCS... SVN is pretty good for most purposes.
    – rmeador
    Jan 21, 2009 at 15:49
  • 2
    Commits in CVS are "atomic" in the same directory (due to locking) but not outside. Recent versions (1.12) have a commit id stored in the RCS file but it is still a hack.
    – Keltia
    Jan 21, 2009 at 17:56
6

I'd recommend reading the two Pragmatic Programmer books on SVN and CVS called "Pragmatic Version Control Using CVS" and "Pragmatic Version Control Using Subversion".

Both are excellent resources full of recipes describing what you want to do rather than the nuts and bolts descriptions of technology itself in the books previously mentioned.

HTH

cheers,

Rob

5

I recommend you SVN on Windows, Git on Linux. Don't use CVS, imho it's terrible.

SVN Book is that what you need first.

Tag every public build (release). Branch is a copying out trunk for some reason - e.g. another way of development. Branch repository everytime when you need :)

5

I believe this is from coding horror:

Chris Birmele's paper on Branching and Merging is the best introduction I've found to this essential source control task. There are dozens of ways to branch, and no one correct way to do it. Get familar with your options so you know what the tradeoffs are with each one.

Branching and Merging Primer

5

Sensible rules of thumb:

  • Tag every build (ie., every build with a build number--anything you might send to testers or anyone else).
  • Branch every time you need to branch.

Usually you need to branch released versions so you can test and release patches. You might have other reasons for branching.

And you're definitely better off with Subversion.

9
  • 1
    "Tag every build" should be "Tag every release"? At best every commit builds but a tag for every revision doesn't make much sense.. Jan 21, 2009 at 15:10
  • I think it's better to say: tag every public build. Build that goes away from developers, for testers or users, etc. Jan 21, 2009 at 15:10
  • 1
    I don't see the need to be stingy, but if you're going to be, "every public build" is probably okay. If something goes wrong from one build to the next, it's easier to roll back if you'd tagged the last build. Jan 21, 2009 at 15:20
  • You don't need to tag every build, simply because every revision is already a tag with the revision number as name (see svnbook.red-bean.com/en/1.1/ch04s06.html) Jan 21, 2009 at 15:44
  • What do you mean by "every build"? If I'm doing it right, each revision number is a build. I can see tagging every build that escapes development (which currently includes some of the nightlies where I work), but aside from that I wonder whether we're using "build" the same way. Jan 21, 2009 at 15:44
3

The later entries in Eric Sink's Source Control HOWTO cover branching and merging.

3

If you want a starter for 10 for subversion:

Treat 'trunk' as a complete history of your development. Everything that ever gets released must appear in trunk at some point and in some form.

Use development branches(branches from trunk) in complicated development tasks. When task is finished, use re-integrate merge to pull changes from the branch into trunk. This way you have a few specific commits to trunk instead of many commits all related to the same task. Delete these development branches when no-longer needed. Name them like 'FeatureX'

Use version branches(again from trunk) to manage marketing versions which are destined to get released to customers/deployed to live. A version is a subset of the revisions in trunk. To use them, branch from trunk at an appropriate revision (may not be head), manually record the revisions from trunk as being merged into that branch, merge in any additional revisions you need from trunk (only from trunk). Do not develop directly onto a version branch, only merge from trunk - although the merge may need extra work to make it compatible with the version. Name like 'Version 2.4'

Create specific tags from your version branches whenever you make a build or hotfix that gets released to customers or deployed into live. Name like '2.4.1', '2.4.2' etc.

Working this way you can use subversion's merge-tracking (version 1.5 and above) to see exactly what's in each tag in a revision by revision basis. To do this, get a working copy of your tag or version branch and do 'svn mergeinfo --show-revs merged http://svn/trunk c:\workingcopy\'

That's great for auditors, auto-generated release notes, testers, and your own confidence about exactly what's in and what's out. Use an auto-generated matrix with this information to see at a glance what different versions contain.

1
  • You say that all changes should go into trunk first, and never to develop directly into a version branch. I agree, but what about fixing bugs in a version branch, whose code is no longer available in trunk (perhaps due to code cleanup or feature removal)? Mar 8, 2010 at 14:26
3

Read this: http://oreilly.com/catalog/practicalperforce/chapter/ch07.pdf

2

you should leave CVS. CVS is old and not very fast in terms of branching/tagging(branch/tag creation depends linearly on number of files in a project)

You should think of your branching strategy first: do you want to have a

  • stable trunk
  • feature branches
  • developer branches
  • unstable trunk / release branches
  • platform branches

This heavily depends on your project and development philosophy

If you want to use SVN you really have to think of your repository layout, because nearly all softwareprojects are module-based and you should find a structure in which you can easily tag all needed modules. SVN with its folderbased approach of branches/tags is not easy to achieve this requirement.

This said it should be clear, that multirepository layouts are more difficult to maintain a stable tagging system. I prefer a "tag all" approach, however this is my personal choice.

2
  • > This said it should be clear, that multirepository layouts are more difficult to maintain a stable tagging system. Without knowing exactly what you mean, I wonder if this can be remedied by the use of svn:externals to pull the multi-repository layout together prior to tagging.
    – RjOllos
    Sep 10, 2009 at 23:27
  • 1
    you can do this by using externals, however things will get nasty, if your subprojects are using externals themselves. There is no way of searching for all externals in all projects and it is PiA to maintain externals in more than one level.. Sep 11, 2009 at 21:44
2

When going to my first real SCM (from source safe) years ago, I found the following helpful - back then there was a white paper by perforce I think:

http://www.perforce.com/perforce/bestpractices.html

1

The Cederqvist is generally regarded as the guide to CVS.

1
  • For what to do, not necessarily how to do it. Jan 21, 2009 at 15:45
1

I'd recommend using GIT as the tagging/branching process is extremely easy to use. The benefit of using SVN (especially on windows) is the number of GUI tools and the windows shell intergration.

I also second the recommendation for the Pragmatic Programmer books on SVN.

1

Well, it doesn't really matter what source control system you use, they all basically follow some form of trunk/branches/tags structure. Even if it's a distributed model, the repositories will be setup in a way to reflect that.

There is a pretty simple explanation to get you started here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.