I'm not a CS student nor trying to give advice to CS students, but Joel's article Advice for Computer Science College Students has some bits and pieces that are close to my heart. The section I am refering to here is Learn how to write before graduating. A quote is in order:
"The difference between a tolerable programmer and a great programmer is not how many programming languages they know, and it's not whether they prefer Python or Java. It's whether they can communicate their ideas. By persuading other people, they get leverage. By writing clear comments and technical specs, they let other programmers understand their code, which means other programmers can use and work with their code instead of rewriting it. Absent this, their code is worthless. By writing clear technical documentation for end users, they allow people to figure out what their code is supposed to do, which is the only way those users can see the value in their code. There's a lot of wonderful, useful code buried on sourceforge somewhere that nobody uses because it was created by programmers who don't write very well (or don't write at all), and so nobody knows what they've done and their brilliant code languishes."
I am inclined to say "Amen!"
Following is an installation recipe for Subversion (a free and very powerful source code control system) plus additional files for a post commit hook (so you know immediately when someone else checked something in; currently implemented as a batch file) and a backup script (so there are no excuses for not backing up your installation!). Assumptions for this recipe:
- We are creating a new repository named Corsavy
- c:\repositories is your repository root
- Backups will be located in d:\subversionbackups
Now for the recipe:
1) Install Subversion (WIN32 download). Modify the PATH environment variable so that it contains the path to your Subversion installation (usually c:\Program Files\Subversion\bin).
2) Create a repository
mkdir c:\repositories
svnadmin create c:\repositories\corsavy
Details can be found here.
3) Edit svnserve.conf (do not forget to uncomment [General]). Details see previous link, however, svnserve.conf does come with plenty of instructions itself.
4) Install Subversion as a service using the SVN Service Wrapper (Note: you have to place it in the bin directory where svnserve.exe is located)
SVNService -install -d -r c:\repositories
5) Optional: a commit hook, post-commit.bat
Put it into c:\repositories\corsavy\hooks, it will be picked up automatically
SET REPOS=%1
SET REV=%2
SET LOG_FILE=%TEMP%.\svnfileR-%REV%
SET LOG_FILE1=%TEMP%.\svnfileR1-%REV%
SET LOG_FILE2=%TEMP%.\svnfileR2-%REV%
SET AUT_FILE=%TEMP%.\svnfileA-%REV%
svnlook info -r %REV% %REPOS%>%LOG_FILE1%
svnlook changed -r %REV% %REPOS%>%LOG_FILE2%
copy %LOG_FILE1%+spacer.txt+%LOG_FILE2%+spacer.txt+%LOG_FILE%
svnlook author -r %REV% %REPOS%>%AUT_FILE%
REM SET THE AUTHOR FROM THE FILE.
FOR /F %%A IN (%AUT_FILE%) DO SET AUTHOR=%%A
blat "%LOG_FILE%" -to "toaddr" -f "fromaddr" -server localhost -s "[svn-corsavy] rev %REV%, %AUTHOR%"
DEL %LOG_FILE%
DEL %LOG_FILE1%
DEL %LOG_FILE2%
DEL %AUT_FILE%
Note that I did remove toaddr and fromaddr in this script (put in the ones you'd like to use instead), and you need a file named spacer.txt (mine simply contains four newlines). For mailing out the change log, blat is used (Note: the line with blat must not wrap). I placed blat into the bin folder of my Subversion installation, so it is automatically in the search path.
6) Optional: backup, a VBS script
Set objWsh = WScript.CreateObject("WScript.Shell")
strCmdLine = "cmd /c rmdir d:\subversionbackups\current /s /q"
nRetVal = objWsh.Run(strCmdLine, 1, True)
strCmdLine = "cmd /c mkdir d:\subversionbackups\current"
nRetVal = objWsh.Run(strCmdLine, 1, True)
strCmdLine = "svnadmin hotcopy c:\repositories\corsavy d:\subversionbackups\current --clean-logs"
WScript.Echo strCmdLine
nRetVal = objWsh.Run(strCmdLine, 1, True)
strFilename = """d:\subversionbackups\"
strFilename = strFilename & Year(Date) & Month(Date) & Day(Date) & ".zip"""
strCmdLine = "zip -r " & strFilename & " ""d:\subversionbackups\current\*.*"""
WScript.Echo strCmdLine
nRetVal = objWsh.Run(strCmdLine, 1, True)
The Zip component in use is Info-ZIP, which is free. The VBS file is run from a scheduled task each night.
That concludes the recipe for installing Subversion - well, almost: the port used by svnserve is 3690 (TCP as well as UDP), so you might need to change the IPSec policy of your server to allow those incoming ports. Same thing client-side, but this time outgoing.