Chris Skardon 的个人资料Chris Skardon日志列表 工具 帮助

日志


2007年9月

Source Control!

I've worked on two different source control methodologies in my brief software career, the SourceSafe exclusive checkout way, and the Vault - edit, merge, commit route.

I've used three applications, Microsoft SourceSafe 6.0, SourceGear Vault (3.5) and currently Microsoft SourceSafe 2005.

They methodologies both have their benefits, clearly the SourceSafe way gives security, you know no-one else is going to be editing your code, and there will be no horrible merge when you check-in. But the major (and personally I think it's a deal-breaker) drawback is that when working in a team of developers you can very easily get into a deadlock situation where developer A needs access to FileB (which developer B has checked out) and developer B needs access to FileA (which developer A has checked out). The usual result of this situation is an 'undo check-out' by one of the developers, or them going 'renegade' and disconnecting from the source control (which will result in a merge).

I recently encountered the deadlock situation above, rolled back my file, waited for the other developer to check-in his changes and then went to reapply mine - problem was - I'd forgotten what I'd done, I'd taken a copy of my original edited version, but suddenly realised - if I just check in my change - I'll just overwrite the other developers code - which led to a large amount of reading the history of the file to try to reapply his changes - to cut a long story short - not a good method!

The Vault route allows you to just do your work, deadlock doesn't occur and this is exactly what we want. Both of us can have the code checked out and the last one checking in has to do a merge. The automatic merge tools are brilliant these days, and if they can't do it, then manual is the way - again, good tools can help this immensely. Vault is the only program I've used to do this and I can't help but praise it, if I ever (again :)) make the source control decision, I'll be heading straight to Vault!

With the advantages there, why don't more people do the edit/merge/commit source control? Fear seems to be one of the biggest stoppers - questions always arise: What about merging? That *always* goes wrong! To be fair, SourceSafe hasn't made merging easy, and I have yet to use CVS etc so I can't comment on those tools, but having a good tool makes this just not a problem.