Bill Bumgarner

2004-9-21

$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.

Comment on this post [ so far] ... more like this: [Hacks] ... topic exchange: [Hacks]

"Stanford: Day 1"

Aaron Swartz is off to college. I'm sure he'll keep 'em on their toes while the rest of us continue to be entertained and intrigued by his observations. Go, Aaron!

Comment on this post [ so far] ... more like this: [Blogosphere] ... topic exchange: [Blogosphere]