views:

106

answers:

2

I have a repository that is running subversion. Some users have not been committing regularly. I'd like to send out a weekly reminder to those that have not committed during the last week. Is there a way to determine when each users last submit date was?

+3  A: 

Beware what you measure, because you will receive it in spades.

Two techniques are possible. You could write a small program to either call "svn log" and pull out the relevant developer names and last commit times. You could add a script to the appropriate post-commit hook which either removes the developer from the email list which is regenerated weekly, or replaces the developer's last commit time in a file that is processed later.

The main problem is that by measuring commits, you'll get more commits. The quality of the commits will decrease dramatically by those who game the system. I foresee comment only commits, or commits of the most trivial nature in your near future.

Edwin Buck
+1 for "Beware what you measure..."
John R. Strohm
While I generally agree with the idea that you don't want to track commits too religiously or force commits of bad (or even questionable) code, I know I've worked on plenty of projects where developers spent weeks and weeks neither committing nor updating their code, committed right before a testing deadline, and caused extensive painful integration failures during crunch time as a result. So I also sympathize with the need to at least pay attention to which developers aren't committing, so that a dev mgr can go find out why they aren't committing.
Jim Kiley
This isn't for a weekly nag email. This is more for the situation where Jim discussed, where collisions and non-committal issues are happening pretty often, and trying to think of a way to fix the problem.
llaskin
In that case, it sounds like you need to make it clear that breaking the head is frowned upon, coupled with healthy use of "svn blame". It's not a foolproof solution, but it shifts the burden of not checking in heavily onto the shoulders of those who check in seldom. If they can continue to break the head / branch with impunity, then you have other issues.
Edwin Buck
+2  A: 

Without trying to address whether you should do it or not, the following will give you a unique list of users who committed between DATE1 and DATE2

svn log -r'{DATE1}:{DATE2}' | grep -E '\|' | cut -f2 -d'|' | sort | uniq

Where DATE1 and DATE2 are formatted as yyyymmdd.

I presume that once you have a list of users who committed, you'll know who didn't as you could compare it against a full list (e.g. diff committed_users.txt all_users.txt).

Kaleb Pederson