Providing customized source code control with CVS
For this purpose, it is necessary to decide the relation of the naming convention of files (usually determined by an extension) and the disposition of them. Some files should not be controlled by CVS. Some files should be treated as binary, such as JPEG and PNG, and some should be treated as text, and this is handled with the cvswrappers file.
CVS is a source code control system, and should not in general be used to store intermediate files. These are generally less useful, as they can be rebuilt at will, they are less directly usable to examine the system, and typical use of older versions involves changing and recompiling them in any case.
Nor all all source files text-based. A PNG image is just as much a source file as a C++ program, in that it is created by people and cannot automatically be rebuilt from simpler components. However, PNG files are not text, and different changes to PNG files cannot be merged in a meaningful manner.
1. Ignoring file types
A file type, for the purposes of CVS, is a regular
expression that matches one or more file names. For example,
*.sl is a regular expression that matches every filename
that ends in ".sl". CVS already ignores some files, including files
that CVS will use ("CVS", "#*"), files that are normally backup files
("*~", "*.bak"), and files that are normally not source files ("*.o",
"*.obj"). It is possible to disregard the CVS ignore list entirely
by beginning CVSROOT/cvsignore with an exclamation point, but many
of the standard ignore list types really should be listed then.
File types that CVS should ignore should be placed, one per line, in the file CVSROOT/cvsignore. This can be done by checking out CVSROOT, editing or creating the cvsignore file, doing a "cvs add" if necessary, and committing.
It is possible for individual users to add to the cvsignore list. If using Unix, they should either put their own list in a file called ".cvsignore" in their own directory (note the beginning period), or have the list separated by white space in an environment variable called CVSIGNORE.
2. Specifying binary types
Many file types should be binary, including image types like
"*.PNG", audio types like "*.WAV", and so forth. These should
be in the CVSROOT/cvswrappers file, one per line, with "-k' b'"
appended. (There are other options, but this is the most common.)
A typical file might have lines like:
*.PNG -k 'b'
*.JPG -k 'b'
All contents of these pages Copyright 2002 by David H. Thornley.
Permission granted for verbatim copying and use within an organization.