I’m a big fan of source code control systems. They help you not shoot yourself in the foot when making changes and it is an essential part of any form of development. Heck, it even comes in handy for managing changes to configuration files.
Solaris ships with SCCS, the source code control system for pretty much all forms of unix. It’s a file based source control system, and is used as the binder for other products such as teamware.
On Linux there’s rcs for file based source code control and then there’s CVS or Subversion for the remote repository work.
Subversion really beats the pants off CVS for features that make it more sensible. If you’ve ever tried to move a file in CVS you know what I mean.
One feature that I tend to use a lot in source code control is the keyword expansion feature. Because SCCS is a file based system, you have to make a conscious effort to edit a file using ‘sccs edit’, and this causes the expanded keywords to be collapsed back to their %..% equivalents. This is of course a problem if you make changes before asking to ‘sccs edit’ a file.
Under CVS/Subversion you need to use the $Tag$ syntax. When the file is pulled from the repository the tag gets replaced by $Tag:<value>$, which is a lot easier to not accidentally munge when committing it back to the repository. CVS performs keyword expansion automatically, which is neat (except for binary files), while Subversion needs to have properties set for a file to ensure that this is done. You can use the ~/.subversion/config file to make files with certain extensions have their keywords expanded.
This is my set of auto expanders:
[auto-props] *.java = svn:eol-style=native;svn:keywords=Date Author Id Revision HeadURL *.jsp = svn:eol-style=native;svn:keywords=Date Author Id Revision HeadURL *.css = svn:eol-style=native;svn:keywords=Date Author Id Revision HeadURL *.htm = svn:eol-style=native;svn:keywords=Date Author Id Revision HeadURL *.html = svn:eol-style=native;svn:keywords=Date Author Id Revision HeadURL *.xml = svn:eol-style=native;svn:keywords=Date Author Id Revision HeadURL *.xsl = svn:eol-style=native;svn:keywords=Date Author Id Revision HeadURL *.dtd = svn:eol-style=native;svn:keywords=Date Author Id Revision HeadURL *.txt = svn:eol-style=native;svn:keywords=Date Author Id Revision HeadURL *.properties = svn:eol-style=native;svn:keywords=Date Author Id Revision HeadURL *.tld = svn:eol-style=native;svn:keywords=Date Author Id Revision HeadURL *.ftl = svn:eol-style=native;svn:keywords=Date Author Id Revision HeadURL *.fml = svn:eol-style=native;svn:keywords=Date Author Id Revision HeadURL *.c = svn:eol-style=native;svn:keywords=Date Author Id Revision HeadURL *.cpp = svn:eol-style=native;svn:keywords=Date Author Id Revision HeadURL *.h = svn:eol-style=native;svn:keywords=Date Author Id Revision HeadURL *.sh = svn:eol-style=native;svn:executable;svn:keywords=Date Author Id Revision HeadURL *.txt = svn:eol-style=native;svn:keywords=Date Author Id Revision HeadURL *.png = svn:mime-type=image/png *.jpg = svn:mime-type=image/jpeg Makefile = svn:eol-style=native;svn:keywords=Date Author Id Revision HeadURL *.dsp = svn:eol-style=CRLF *.dsw = svn:eol-style=CRLF
By adding/editing the enable-auto-props entry under [miscellany], you can make the use of keyword expansion automatic for newly created files.
Ever play with mercurial ?-)