For my code, I keep to a fairly small list, though slightly longer than some people above would like. But, once the file is created, I seldom alter it, apart from the copyright date range:
/*
@(#)File: $RCSfile: stderr.c,v $
@(#)Version: $Revision: 8.29 $
@(#)Last changed: $Date: 2008/06/02 13:00:00 $
@(#)Purpose: Error reporting routines
@(#)Author: J Leffler
@(#)Copyright: (C) JLSS 1988-91,1996-99,2001,2003,2005-08
@(#)Product: :PRODUCT:
*/
My code was originally under SCCS control; I migrated to RCS prior to Y2K to avoid problems with SCCS. I use the @(#)
so that the what
command spots the lines, and leaves ident
(the native RCS equivalent of what
) also spots the lines. The :PRODUCT: stuff is related to the way I distribute source - this file is embedded into all sorts of products, and the current product name is edited into the code as I distribute it -- consider that a personal quirk. Some of my files have an explicit @(#)Licence: :LICENCE:
line in the header - most do not.
I'm thinking of migrating to other VCS (probably git, but not decided for sure yet). At that point, I'd have to review the automatic version information -- if the VCS does not support such things, ... well, I might not use it (I regard it as very important, and is my biggest gripe about Clearcase, which I use at work) ... or I'd have to rethink the header information. You should do the same before blindly adopting what I suggest.
I have similar headers for other languages. I also have a script that generates a skeletal file with my standard header in it, so I can write newdoc somefile.c somefile.h
and not need to do very much to it beyond fill in the purpose of the code in the file. I have a script for editing the copyright date list, too. (Actually, a lot of my programming work style could be summarized by 'I have a script for it'.)
I also embed version strings into executables. For example, one command in my bin directory is linkpath
and I can see what code is in it (my command line prompt is 'Black JL:` because my machine's name is 'black'):
Black JL: what linkpath
linkpath:
$Revision: 2.34 $
$Date: 2008/07/26 04:06:31 $
$Id: stderr.h,v 8.22 2008/08/09 20:12:49 jleffler Exp $
$Id: linkpath.c,v 2.34 2008/07/26 04:06:31 jleffler Exp jleffler $
$Id: dirname.c,v 2.5 2008/02/11 08:44:50 jleffler Exp $
$Id: errhelp.c,v 8.4 2008/08/09 20:13:12 jleffler Exp $
$Id: stderr.c,v 8.29 2008/06/02 13:00:00 jleffler Exp $
SunOS 5.10 Generic January 2005
$Id: jlss.h,v 2008.2 2008/06/03 10:13:42 jleffler Exp $
Black JL:
I find that useful, too.