Contribute to projects
When working on existing projects be sure to coordinate with peers working with the same code. In particular make sure that changes you make do not adversely impact others.
Changing Code
The CVS repository contains the most recent software version. It is continuously changing and which means that it is inherently unstable and may introduce recent errors. Before you update your sandbox from CVS you should save any working copies you have. This way if the update fails then you can revert to your previous copy.
Software development is an ad hoc process with complex interdependencies that are often indirect or hidden. We will all make mistakes and your work flow should take this into consideration. However, it is beneficial to keep the repository in good working condition. If you do make a mistake please try to correct it quickly. Also after you check in changes, check them out into a test directory so you can check your results.
As you browse existing code this is a good opportunity to make minor changes to make the code more readable. Reformat code that is cluttered or is not evenly lined up. As you learn how the code operates add comments so the next person does not need to reverse engineer it again.
If the project does not have any tests then it is a good idea to add some. This way after you can see that your changes did not have damaging side effects. A simple smoke test is a reasonable start and will catch obvious errors.
Check In Changed Code
Between the time that you checked out a project and you are ready to submit changes another developer may have modified the same file. You can use these commands to check for conflicting changes.
> cvs log <File> # List the change history for a file. > cvs diff <File> # Differences for your copy of a file.
If there are conflicts you will need to resolve them. When you are ready to check in a change then use:
> cvs update <File> # Merge recent changes into your copy. > cvs commit -m "<Comment>" <File> # Add your file to the repository.
The commit comment is logged in the history for the file. It is a terse reminder for the change. When checking in a group of files use the same message for all the files.
After you are done submitting changes verify that they are correct. Create and go into a scratch directory for testing. Check out the project, build it, and run it to see that it still works (See Create and automate software tests).