We use Clearcase at our office, and based on my admittedly light knowledge of clearcase, it just seems like a really bloated source control tool.

I know from hearing friends talk about Clearcase that it's really powerful. My question is, what are some features of Clearcase that make it 'powerful', and what are good tips and tricks for getting the most out of Clearcase?

This question came from our site for professional and enthusiast programmers.

If you need more details, let me know: I manage our ClearCase server for a few hundreds users for the last 6 years, but I manage also Subversion. I know what kind of project (size, organization, workflow, ...) would benefit from using ClearCase or not.
–
VonCJan 16 '09 at 9:37

We have a 10 member team that uses Clearcase for one .NET solution.
–
George StockerJan 16 '09 at 14:57

... In that case, ClearCase seems a little over-the-top unless you have a complex merge workflow because of multiple parallel development efforts. If your development is sequential and if you do not have many inter-dependent project... SVN is enough IMO.
–
VonCJan 16 '09 at 15:26

Yes: You should know that Linus Torwalds thinks you are a "git" and you should move to Git instead! Just kidding. I recommend you see the first minutes of gitcasts.com/posts/railsconf-git-talk, not for Git itself but for positioning perforce amongst other SCM.
–
VonCJan 19 '09 at 6:53

14 Answers
14

The one historic feature that ClearCase has over its competitor is the dynamic views: that MVFS (Multi Version fileSystem) allowing to access files over the network rather than downloading them on the hard drive.

This is not the only way to work with those files: you can combine snapshot views (your classical "workspace") and dynamic views, but it is really useful.

The other powerful features are are based on simple concepts:

branch is a first-class citizen (and not just a "directory" like CVS or SVN)

tag is not the same than branch

Version tree is simple and intuitive to understand.

lazy branching allows you to easily create a branch and isolate whatever development you need.

directories are managed in version control like files are: remove a file and it is actually the history of the parent directory that changes (simple dereferencing).

Then there is UCM (Unified Change Management) which introduces some interesting best practices (like the baselines: a label put on a complete set of file: the component, and which can not be moved - that avoid nasty surprises ;) -)

In my opinion, a correct use of UCM is the fastest way to leverage ClearCase features, provided you use the UCM streams (set of labels, and pattern for branches) wisely, that is to represent a development effort (current dev, patch, refactoring, assembly, ...), and not just to build a private workspace for a development: myStream is wrong: stream_dev is better. (If you have 15 developers with their own streams, you set yourself for countless merges back and force between the different branches associates with those streams!).
Basic rule of thumb: the name of a stream must represent a development effort, not the name of a resource (developer). The effort is here to stay, the developer can come and go.

The other best practice is the merges in UCM: they come with their own semantic based on the stream organization: "deliver" for merge from sub-stream to other streams, "rebase" for merges from parent stream to child stream.
In the end, those are still classical merges, but I find them very easy to explain to developers, and they can organize their "workflow of merges" based on a true development lifecycle very easily.

The notion of activity (or changeset) comes also in UCM and is very useful to detail his/her work.

I will not detail here the drawbacks and quirks of ClearCase since it is not the question ;)

@VonC: Would you be available/willing to field a few personal CC questions? I am using CC for the first time (used SourceSafe, SVN and PVCS in the past) and am am having trouble understanding a few things (janderson at iccohio.com).
–
Jim AndersonJan 29 '09 at 15:59

It doesn't just seem like it. It really is a bloated development tool.

I don't have much useful to add, as I'm currently finishing up the first (and last hopefully) project where I used clearcase, and am on SO killing a couple of hours till punch out :P

I never found any good ways to "leverage" clearcase at all. It was more about figuring out how to tolerate it.

Setting up an unofficial GIT parallel source control system with your team was about the most effective thing we did. You can use clearcase to check files in/out from the repository into a local dir, then set it up as a git repo, add the files to it, then clone that repo into another local dir.

From there you can work normally (without CC's irritating check in/out setup), branch, share code with other co-worers etc.

When you're done with a piece of work, just pull it from the work repo, to the clearcase mirror repo. Add your changes to CC, then deliver it to the integration stream to keep the official powers that be happy.

Beware though, this approach REALLY highlights CC's shortcomings, and will likely make you dislike it even more. For instance, git took 10s to merge a large number of changes automatically. CC took 50 minutes to do the same thing, and required all sorts of manual baby sitting.

CC is bloated and needs a stupid amount of hardware resources assigned to it in my experience, but it's a really great tool. Funnily enough, I never really appreciated it until I left that place and went to another job where I had to use Subversion instead.

What is so great about it?

Multisite support

MVFS

The idea of the config spec, being able to deal with different versions/labels/builds without having to have 10 different versions of the codebase checked out onto your developer machine's hard disk.

To be fair, here's what I really dislike about it:

Bad Windows support, a lot of slightly advanced tasks require you to drop into a Unix shell to perform unless you want to spend a lot of time accomplishing the same thing in cmd.exe

You don't need to checkout 10 different versions of the codebase in subversion. You can use the "switch" command to change your working copy to a different branch or tag. Subversion will even minimize network traffic by only fetching the differences.
–
Wim CoenenJan 16 '09 at 12:06

@wcoenen: configspec provides much more than SVN's switch command. It enables to have different versions for each element.
–
graygerMar 4 '09 at 14:36

1. Windows version of Clearcase gives you the same functionality as the Unix one. "cleartool" command have the same options on Win as on Unix, and gives you access to all Clearcase functionality. 2. Administration overhead is quite common. See what MS TFS installing and administration means.
–
MariusCCMar 11 '09 at 12:37

@MariusCC: cleartool may have the same options, but cmd.exe is so lacking that you really need to use a unix shell. Of course it is technically possible to use Windows, but what would be a standard cut+Paste command on unix usually turns into a multi-step process which requires some fiddling.
–
CoxyMar 12 '09 at 1:02

I don't know about you, but the CC integration into VS from version 7.x on has been fantastic for me.
–
Robert PMar 13 '09 at 1:22

One of the key features of Clearcase compared to at least some other VCS is the strong versioning (and branching) of directories. Only today, I checked in a cleanup to the top level directories of two of the main VOBs that we use. In one, I had removed over 60 obsolete files; in the other, over 80. Those should have been removed long ago. But they are only removed from view. If anything has gone missing that needs to be recovered, it is all still there in the VOB, ready to go.

Clearcase also supports file renaming too.

I'm not sure which of the other VCS support directory versioning.

Used carefully, the ability to branch directories is invaluable. Used carelessly, it is a recipe for confusion bordering on disaster.

Subversion definitely has these features. The fact that good support for renaming/moving files and folders was lacking in CVS is one of the main reasons that Subversion was created.
–
Wim CoenenJan 16 '09 at 11:59

There are of course many other advantages, but first, I think it would be worthwhile to list down what YOU want to achieve w.r.t version control and configuration management in general. Then there could be a more specific discussion to see how (or IF) clearcase can help you achieve these goals. IMO that approach might be of more help to you since this is such a broad topic.

I tried to make it as 'non-loaded' as possible. I don't know whether Clearcase is bloated or not, but if I were to ask people's opinions, the answers follow neatly along the lines of 'God yes!' or 'hell no! it's feature ridden.' I want to leverage those features.
–
George StockerJan 16 '09 at 13:47

Oh? How was your experience with Multisite? I've heard...less than good things.
–
Robert PMar 13 '09 at 1:35

CCRC is only really useful since CC7.0.1.x (last September). The first iterations of CCRC were... subject to improvement! As for clearmake, is seems rarely used in other projects than C/C++ one.
–
VonCJan 16 '09 at 15:28

Can't agree more - could really only get triggers to work with CCRC when 7.0.1 rolled round. However, 7.1 looks fabby. Have you tried it?
–
SpedgeJan 19 '09 at 8:28

Don't you think most of people telling SVN is good and Clearcase is bad just tell so because they didn't even give a chance to Clearcase? I mean, a correctly set up clearcase (no UCM please!!!) is far much better than SVN:

I've been working with ClearCase for three years. We have 3 intelligent guys working just to maintain it. I can say it: ClearCase is bad! Even if they cost the same, Subversion is a lot better (and free!).
–
nevesAug 27 '14 at 20:06

One of my favorite features in ClearCase is that every change to the vob is simply a revision to the vob, from deleting a file to making a merge to making a checkin. For example, if your merge goes poorly, you can completely undo it simply by undoing that change. Deleted a file, but then decided you actually wanted it? Good news, the 'delete' operation was simply a change to the folder's contents. You can roll back to the folder's previous version and your file returns.

The Version Tree, as others mentioned, is a fantastic piece of work. In a few seconds you can see the entire history of any file or folder, with all its branches and versions. You can manipulate it the version tree to get at just the branches you want, then quickly compare between any version of the file.

I have no complaints about the built in merge tools. They get it right almost all the time, and the diff viewer is pretty fine.

The trigger system is very flexible. This is the make or break for most clearcase installations, I think. If you have a good set of triggers (auto-delete 0 branches, force comments, check for duplicates, ensure bad branches don't get made, others as you see fit) the system will flex and bend to your will. Bad or no triggers and you'll probably have a less than futfilling experience.

Be warned: there is a lot of overhead and knowledge needed to use ClearCase effectively. When I started using Clearcase in general, I hated it - config specs, viewer this, vob that, why do I need three views just to look at my three branches, etc. In addition, the CCRC that is in the works has different behavior in many places, and looks like it will become the new standard client for clearcase. However if you can crest that hill and get to a level of understanding of the system, you can make it sway and bend to your will with ease.

+1 for the knowledge required. I have used SVN a lot in the past and it was quick, did everything I needed and just worked. Current project uses clearcase and the amount of time wasted to get a simple snapshot view I can run my tests on is astonishing. I don't ever need to commit changes back - just carrying out a test role - and CC is wasting about an hour a day. Trying to grab some info from one view and running testing in another using that info - well nigh impossible. And trying to get consistency between win, solaris and aix - forget it!
–
Rory AlsopApr 5 '11 at 13:01

On my current project, we're using ClearCase. To be honest, most of the development team wants to switch to Subversion, but we cannot for political reasons.

First off, if you can afford devoting folks to SCM work, I would recommend doing so. SCM work is not just about making sure ClearCase works. You also want to be able track whether commits are tied to your issue tracking database, and whether it ties into your continuous build scripts (we're using CruiseControl). This applies to any VCS.

Second, be sure to make sure your development team is using the same diff tool. I've found BeyondCompare to be the best, though I'd be happy to settle on WinMerge if money is tight.

Third, one really great thing about ClearCase is that it can show an entire version tree with branches and merges for the change sets with respect to a given file. Keep this working, because it is very useful for doing "code archeology". E.g. sometimes when I need to track down the source of a bug, the CC version tree tool helps me to chase down the person who introduced the change that introduced the bug.

Fourth, I would watch carefully for how your version of ClearCase handles merges. Yes, its merge algorithms have gotten better with successive releases, but we've been burned by ClearCase's merge algorithms making mistakes (especially when it hasn't capitalized on smarter knowledge of the syntax tree for a given file type).

If you have clearcase and still need a diff tool then you are not using clearcase correctly in any way, shape or form. Now wonder your team wants to switch to subversion.
–
DunkMar 13 '09 at 1:50

1

@Dunk : Clearcase Diff absolutely gets borked if you have a .cs file (or any other IDE that can auto indent if you ask it to) and the developer before you checked in his code without hitting Ctrl+K+D in VS editor. Clearcase highlights whitespace changes (horizontal and vertical) as changes.
–
George StockerMar 13 '09 at 2:12

I used ClearCase (on Windows) for a project about ten years ago and have felt poor in comparison with every VCS I've used since. Mind you that was my first exposure to VCS so I might be viewing it through slightly rose-tinted spectacles. The things that I really liked about ClearCase were:

clearmake and the audit records (config record, can't remember the exact name) that were produced (every version of every file identified as it built your code, and then you can label everything based on the audit record)

I always thought the version selection language for views was superb and loved the flexibility + the selective branching (give all the files under this directory from this released version of the component but if I make any changes, check it in as part of this branch).

try to be in a state when you have to merge the latest versions of all files of a given tree from a branch to another instead of some version of a subset of those files.
In the former case, findmerge will handle that without any problem (or "deliver" if this is UCM)