开发者

How do we count subversion commits per user

H开发者_开发问答ow do we count subversion commits per user


This gives a quick histogram by counting entries from the log in xml:

svn log -v --xml | grep '<author.*/author>' | sort $* | uniq -c | sort -rn

   1841 <author>joe</author><br>
    735 <author>jimbob</author><br>
    129 <author>sally</author><br>
     32 <author>mike</author>

Could tack on a sed command to clean things up more, but thats answers the posted question..


Use the SVN dumps:

svn log -v --xml > logfile.log

Then you can either do the data mining by yourself, or use StatSVN.

Another option, which uses shell commands only (and is actually kinda nice), is detailed in this blog post.


You could use StatSVN. But what do you want to achieve? commit count does not need to say anything!

Keep it in mind.


PanBI also supports Subversion analysis, one of which is the number of commits per developer over a time period. You can see what it does in a few minutes in the screencast.

There are 3 steps:

  1. unpack the PanBI distributable
  2. set the subversion URL in panbi.conf.xml
  3. run the "run-all-no-worries" .bat or .sh script

Disclaimer: it's my own project.


You can use a post-commit hook(trigger) on the server. Inside the trigger you can write info in a database or in a CSV file that can be processed later.


Use SVN log

svn log -v --xml url > logfile.xml

For date range

svn log -v --xml <url> -r {2016-01-30}:{2016-05-30} > logfile.xml

eg: svn log -v --xml http://repo.abc/xyz -r {2016-01-30}:{2016-05-30} > logfile.xml

and then open the file in notepad++. The Find tool has a count button. Find by authorname or authorid, and use count button to find the number of commits by the person.

This can be executed from windows command prompt , but you need to add '\' before '{'. ie: svn log -v --xml http://repo.abc/xyz -r \{2016-01-30}:\{2016-05-30} > logfile.xml


There is a nice stat option in Tortoise SVN client for Windows. You access it from Repo-Browser "Statistics" Button. You can specify the date range. Filter on User, Paths, Comments content...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜