$Id: and integrating source

Recently, I have been integrating changes from one open source project into another project. The open source project uses $Id: style keywords in all source files. These are expanded by CVS to indicate who last touched the file, the date, version, and some other info.

Sort of useful, I suppose, but a total pain in the butt when integrating changes. It means that everytime I integrate the code, the default behavior is to make a one line change in every single file.

Clearly suboptimal.

When using diff (the command line tool) to produce patches or otherwise analyze the changes, it is helpful to exclude any diff triggered by one of the $Id: markers. Trivial (and this excludes autoconf products, too):

diff -r -u -x 'config*' -I '\$Id:' dir1 dir2

Now, it would be much handier if the CVS repository simply didn’t ever expand the ‘$Id:’ tags in the first place. This would mean that you could always look in files checked out from your local CVS repository and see the version # of the original source file. Again, easy:

cd top/dir/of/your/workarea
grep -lr '\$Id:' * | xargs -n1 echo cvs admin -ko

Of course, you will want to do the above before comitting any of the files or updating the workarea.



Leave a Reply

Line and paragraph breaks automatic.
XHTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>