views:

73

answers:

4

Are there any arguments out there against keyword substitution (i.e. replacing $Revision$ with $Revision: 5$) as a feature in version control systems?

I'm not looking for a debate. I'm looking for well thought-out arguments by people who think the feature is a bad idea.

Here is one such argument:

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.

Again, I'm not interested in a debate, just good arguments agains the feature. I can make up my own mind, but want to have good data with which to do so.

+1  A: 

One argument against is what the article you link to calls a "binary integrity standpoint": When comparing files from two different revisions, you'll get a lot of false positives because of the changed revision stamp.

Also, when updating a working copy in a project that uses keyword substitution, every file will have to be updated, which can be expensive traffic-wise and otherwise (e.g. if you're doing a live mirror of your working copy or something).

I don't really see much of a problem in this, though: If the side-effects of keyword substitution are going to be a problem for your project, simply don't use it. All in all, I think it's a great feature.

Pekka
Updating every file kills incremental builds, that would be worse than the traffic in most cases. (btw. the question is likely about *using* that feature, not its existence. You last two sentences are kinda funny)
peterchen
@peterchen good argument - but as I said, the solution then is to simply not use it IMO. It's not necessarily an argument against offering the *feature* itself. But, the OP wants negative arguments so fair enough
Pekka
Of course, I don't argue for purging this feature from all VCSes ;)
peterchen
+2  A: 

I'll admit that it's been very many years since I used keyword substitution in a version control system.

The really hard one to justify is $Log$. It seems like a good idea at first, but after a short while it really starts to clutter up the source. The information is easily available from the version control system when needed, so having it in the file is redundant.

Mark Ransom
I agree that `$Log$` is a really bad idea, especially in a DVCS or when you have branches because it quickly becomes so confusing to figure out which order that things happened in that you stop looking at it.
Omnifarious
+2  A: 

Well, what arguments do you have for it?

If you need any version information: "who changed what, when, and why?", ask your repository.

If you have source trees where you can't tell which version they are, or even source trees with files from different versions, you might be doing something wrong (meaning: I can't see a use case that justifies this.)

In addition the information may be plain wrong. When I fetch a file from the repo, and edit it, the header will still say "this is revision 124". It's not. Only your repo can tell you "this file differs from revision 124 by the following changes:".


I've used CVS only during a brief stint, when all this version-what?? stuff was rather confusing anyway. We've moved via VSS to GIT, and I've never missed it.

(I do remember that it seemed to be important for CVS.)

peterchen
+1  A: 

It is a confusing feature, because it causes the "real" content of the file to be different from what you get in your working copy. This leads to the following questions:

  • What happens if you edit the substituted text in the file and commit. Will it result in an error on commit? Will it replace the original keyword in the "real" file? Will the change be ignored?

  • How do you edit the keyword in your working copy? After all, you can't see it any more in the file - it has been substituted.

After reading how it works in subversion, the answers are not at all clear to me. I would have to try and see to be sure. To me, that's an indication that this feature is more trouble than it's worth.

Wim Coenen