1

We have recently moved from using Visual SourceSafe for source control to using Git.

While SourceSafe has justifiably had a lot of criticism it has one feature which was quite useful: Keyword Expansion. Keyword tags could be added to source files. When SourceSafe checked in a file it would read the keywords and add informational comments to the head of the file.

The SourceSafe keyword we found most useful is $History: $. When the file is checked in the checkin comment is added as a comment to the head of the file. We find these checkin comments particularly useful in SQL scripts used to update objects such as stored procedures in a database.

Does Git have any equivalent method of inserting metadata comments into source files during commit?

Simon Elms
  • 17,832
  • 21
  • 87
  • 103
  • People should listen to what Peter says. I hear he's a smart guy. – Adam Dymitruk Sep 07 '12 at 02:42
  • 1
    The Smudge/Clean Filters in one of the answers in the x-ref'd question look like what you want, more or less. Actually, I'm very far from convinced that the checkin comments are really useful; that information is in the repository and best left there. But version identification, etc — that I think is useful. It means you can have a better chance of identifying where a copy of a file came from even when it is detached from the rest of the code shipped from a repository. – Jonathan Leffler Sep 07 '12 at 05:18
  • @Jonathan Leffler: You're right, mostly we use the history just to tell which version a file is. Not so important for compiled code but very useful for "interpreted" code like scripts to update SQL objects. – Simon Elms Sep 07 '12 at 05:46

0 Answers0