Tony Finch – blog

submited by
Style Pass
2024-05-13 16:30:07

There are a couple of version control commands that deserve wider appreciation: SCCS what and RCS ident. They allow you to find out what source a binary was built from, without having to run it – handy if it is a library!

It was a BSD tradition to use keyword expansion everywhere. I first encountered it when I got involved in the Apache httpd project in the late 1990s – Apache’s CVS repository was hosted on a FreeBSD box and used a version of FreeBSD’s CVS administrative scripts.

When unifdef was uplifted to git, I wanted to keep its embedded version control keywords – I have a sentimental liking for this old tradition. If you’ve installed cssc, rcs, and unifdef on a Debian box, you can run,

Each line is prefixed with an SCCS magic marker @(#) so that what can find it, and wrapped in an RCS-style $Keyword$ so that ident can find it. There’s a fairly trivial version() function that spits out the copyright[] string when you run unifdef -V.

I enjoy keeping this old feature working, even though it isn’t very useful if no-one knows about it! Maybe if I blog about it, it’ll become more widespread?

Leave a Comment