Subversion Change Log Report

Depending on your perspective, you may call it paranoia or staying on top of the software development process, but, in my experience architects/senior developers need to track changes to the version control. If you are a team lead, you HAVE to know what your developers are putting in the version control.

Back in old days (several years ago), when we were still on CVS, Doug wrote a nice perl script, tied it to a cron job and we were recieving list of daily commits to CVS regularily.

Now, of course SVN makes everything that was hard in CVS easy. You don’t need to write perl scripts, any more. A colleague of mine has recently asked me how to do the same in SVN, since they are just moving to Subversion.

This is how:

svn -v -r “HEAD”:{20061015} log svn+ssh://user@example.com/svn/module
Which for a crontab-usable script would make a source like:

#!/bin/sh

distList=”bill@microsoft.com, steve@microsoft.com, vista@microsoft.com”

yest=`date –date=yesterday +%Y%m%d`

/usr/local/bin/svn -v -r “HEAD”:{$yest} log file:///reproot/module |
mail -s “Daily Commits to Module” “$distList”

where file:///reproot/module is your SVN URL, of course. The last two lines should be on the same line (we just can’t do it here due to space constraints) and you have to indicate full path to svn binary, otherwise it will not work from cron (even if it works from just shell).
I like to recieve updates twice a day, so my crontab looks like:

0 1,18 * * * /home/irakli/bin/dailysvnchangelog.sh > /tmp/dailysvnchangelog.log