I know it has been said many times before, and I know it’s just common sense, but after a little incident this morning I think it bears repeating: When you’re ready to check in your updates, be sure to catch up with the latest version before starting the check-in process.
We – my pair partner and I – were doing a little refactoring exercise at the end of a programming episode. We decided we had done enough for now, so we’d check in what we had and move onto the next card. So we fired up the SourceSafe (I know, I know) check-in process. It told us that someone else had changed one of our source files since we had checked out. That’s good: it prevented us trampling over someone else’s work. We went through the merge items and satisfied ourselves, by eye, that we had made the right choice in each case. SourceSafe then went ahead and committed the merged version to the integration stream. Wait a minute – that means we just checked in code that had never compiled, let alone passed any tests!
Fortunately, in this case no harm was done. Our merge-by-eye had worked. This time. But any decent CM tool should behave differently, in my opinion. Instead of merging and then checking in with cavalier disregard for the consequences, it should have simply aborted the check-in process when it noticed we were out of date. So now we’re forced to adopt a convention, a team policy that says
“merge from the integration stream into your workspace before every check-in, then re-build and re-test, and only then check in.”
I very much dislike the idea of having to rely on a policy for something like this. I find it very difficult to adopt new habits, and onerous to have a whole list of things to remember each time I carry out a task. And to ask a whole team, or department, to do the same is somewhat optimistic, to say the least. We need a CM tool that “stops the line” and forces us to catch up before we are allowed to proceed. This would follow the Toyota principle of jidoka or autonomation, effectively eliminating one source of manual error and rework.
(More on catching up before checking in can be found in the literature on team streams.)
Update, 21 jun 05
Subversion gets it right, of course.