CMSC 435/634: Introduction to Computer Graphics

Using CVS to submit assignments

Overview

CVS is a popular free revision control system. It is designed to allow one or more people to work on the same project, keeping checked in versions of files in a common repository. Its main use is for managing source code in projects with multiple developers, and it includes some pretty nifty support for merging independent changes to text files. In fact, using some sort of revision control is almost required for any reasonably complex software project. The revision tracking features are pretty handy even when working alone. You can go back to any revision of your files that was ever checked into the repository, either by revision number or date. I use it for the revision tracking features for all of my web pages, lectures, exams, papers, ....

In our case, you will be checking in your assignment files, and the TA and I will be checking them out to grade. I encourage you to check in changes often, but in the end you just need to make sure the required files are checked in for each assignment by the deadline.

Initial checkout

First, you must check out your directories from the repository. This will give you your own working copy of the files. Do not attempt to work directly in the repository, CVS will get quite confused if you do this, and we probably won't be able to check out your code to grade it! On the GL systems, you'd use a command like this

cvs -d /afs/umbc.edu/users/o/l/olano/pub/435fa11 checkout -d directory_name_of_your_choice your_umbc_username

For example, I might do this:

cvs -d /afs/umbc.edu/users/o/l/olano/pub/435fa11 checkout -d cs435work olano

This is the only time you need to tell it where the repository is. After the intial checkout, once you cd into your working directory, CVS can figure out which repository to use. All of the major CVS commands apply to the current directory and all directories under it.

Editing

Edit away... No need to do anything special

Adding, removing, and ignoring files

If you add files, you ***MUST*** let CVS know so they'll be checked in:

cvs add file

To tell CVS you're removing a file (so it won't come back next time you update — see below):

cvs remove -f file

To tell CVS to ignore a file (executable, rib or tif file you generate, for example), add it to the list in the .cvsignore file in that directory. I've added a bunch of initial files to ignore to the .cvsignore file for you, but you are free to add more.

Check pointing your changes

Your changed or added files are not copied to the repository until you check them in. You must do this for us to be able to check out and grade your work, but you can do it as many times as you want before then. First do this:

cvs -q update

Files CVS doesn't know about will be listed with a '?'. Next, tell CVS to add or ignore each of them, then try the update again. It's good practice to make sure CVS knows about every file before you commit any check in.

Now check them into the repository:

cvs commit -m "short message about this checkin"	

Now check to make sure it worked:

cvs -q update

This time, it shouldn't list any files. If it does, something went wrong. Make sure you've tolc CVS to add or ignore if necessary, and try again, or ask for help.

Submitting a version for grading

Since you can check in as many times as you want, we need a way to know when your project is ready for grading. You'll do this by tagging that version when you are ready. For example, to submit assignment 1, you'll first commit your changes, then tag them by running

cvs tag -R submit assn1

Run this command from your main directory, and you should see it list all of the files that are being tagged for submission. As a sanity check, you can check out a new copy of your repository, then grab a copy of everything tagged "submit" to make sure it is all there:

cvs update -r submit

Getting updates and previous revisions

If I make any changes to the initial sample files (or add files the later assignments), you can get these using

cvs update -d

You can compare your current version to any previously checked in version with

cvs diff -D date file

You can also get a whole new copy of your checked in files from any past date by adding the -D flag to your checkout command, though this can leave your repository "stuck" on the previous versions until you do a "cvs update -A", so I'll often just check out the previous date in a whole new directory just to be safe.

To figure out which revision is which (assuming you entered reasonable log messages when you committed your changes), do

cvs log file

Learning more

List of all CVS commands

cvs help

Help on any one CVS command

cvs --help command

General CVS manuals, downloads, etc.: www.cvshome.org