Source Control
The $G tree is not intended for users to write to directly, and future IT plans for our group include enforcing this restriction. Instead, we use the revision control system CVS as an interface to the directory structure in $G. CVS keeps track of changes to every file, allows concurrent editing of source code by multiple people, and provides an easy means for copying source trees to new locations.
Ordinarily, the first steps of development for your own software project happens somewhere in your homedir. This doesn't allow other people to work with your code, though, so once it's nontrivial you should add it to $G:
- Go to the directory that has your source in it.
- Delete or move away anything you don't want to go into CVS. If you already have something compiled, do
make cleanto get rid of the object files---you don't want to put them in CVS. In general, just leave the Makefile and the source files.- Note: even though non-source files are sometimes necessary for builds of complex projects, data files don't belong in
$G/src! Carefully consider whether non-source files belong in the$G/src, and put all others in$G/datainstead.
- Note: even though non-source files are sometimes necessary for builds of complex projects, data files don't belong in
- If you have any binary files, like images that you want to go in CVS, move them out of this directory temporarily. We will add them later because CVS requires non-text files to be added with a special flag. Once again, keep in mind that if a binary file is not necessary to the build process, it's probably data and belongs in
$G/datainstead. - Run the following command, replacing <projectname> with the name you want your project to have---that will become a new directory under
$G/src:gfxprojinit <projectname> .
- Note the period at the end of that command. It might be hard to see, but it is important.
- It's worth knowing, for those familiar with CVS, that
gfxprojinitis essentially a fancy wrapper aroundcvs import. Please be sure to usegfxprojinitanyway, as it maintains important metadata and may do even more in the future.
- If you had some binary files you wanted to add to CVS like images that you load up in your program, do the following for each file:
- Copy the file to
$G/src/<projectname> - From within the
$G/src/<projectname>directory run the command:cvs add -kb <filename>
- Copy the file to
- After adding all the files, run:
cvs commit -m "<Commit message>"
- Your project should have been automatically added to the
$G/srcdirectory on the filesystem you are on now. To get it in the$G/srcdirectory somewhere else, like at the Cave, run this command from within$G/src:cvs update -d <projectname>