Track

I use Perforce at work, and it is a pretty good version control system, even though it’s non-free.

One of the best things about it — and this is such a simple thing, too — is that files you haven’t “checked out” aren’t writable, so there isn’t any chance of you accidentally editing a file without knowing that you’ve checked it out first. And, the changelist support is pretty neat: you can group files you are changing together, and keep them (and change notes) going as you edit the files.

I wanted something similar for CVS hacking, but wanted to expand that idea a little such that in addition to having everything read-only until you’re ready to check out files, you have to enter a change note for that file when you check it out.

I wrote a little shell script called track that does this. It gives you three commands:

  • checkout: marks files as writable, and asks you to enter a change note for that file.
  • checkin: marks files non-writable, and saves your change notes in “file-name.changes”.
  • status: prints whether or not the file is writable (checked out), along with the current change notes.

I kind of like utilities that force me to do the right thing, because I very often forget to, or am too lazy.