Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Are there any arguments out there against using the keyword substitution (i.e. replacing $Revision$ with $Revision: 5$) feature in many version control systems? Are there any overall bad practices that using the feature encourages? Are the any pervasive and hard-to-solve problems that it causes when you do use it?

Here an argument against using it:

It's succinct, and I think the argument about the problems it causes for binary files is cogent, but I don't find it compelling.

share|improve this question
up vote 6 down vote accepted

This is an artifact from the old days, where files were versioned on an individual basis (think RCS, SCCS, and CVS) where modern version control systems think in atomic commits and not individual files. This means that in the old days it made sense to keep track on a file level basis and the best way to do this was in a way that could make its way to binary code. Hence expandable keywords which could go in strings that could go in the object file.

These days, you have a single commit identifier which only need to be registered once for any binary and which can be explicitly scripted to go in a file instead of the versioning system expanding keywords.

This is better, simply because it means that the sources only change when YOU edit them.

share|improve this answer
+1 just for that last sentence! – Frank Shearar Nov 15 '10 at 9:47

Any revision system that cannot tell text files from binary is completely broken.

I think though that they are right that you don't really need it; you often need a way to get your revision # to show-up automatically and they provide an example.

I think most other usages of this feature are superfluous but not harmful.

share|improve this answer
Unfortunately, I cannot yet vote up. – Omnifarious Nov 14 '10 at 20:36

It can be misleading. If I copy a folder out of source control to a separate tree, then edit it, it will no longer have the correct revision. You can not simply look at the expanded revision string to determine which version of a file you have.

However, I still think they are valuable. Having the expanded version string in a file you find outside the source control system allows you to know where to start your search through the history to determine it's validity. I've found myself needing to do this at least twice in the last month.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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