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?
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.
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
).