How do you get the count of svn commits log
for projects under git controls, I use git shortlog
to get counts of commits.
currently I am working for a project unde开发者_运维问答r svn controls.
How do you get the count of svn commits log?
There is no built in command until svn version 1.6. You may use svn log
to create a plain text or xml log file and use a parser to create the statistics.
svn log -v --xml http://www.sourceforge.net/svnroot/
As an alternative you may use statsvn.
Subversion projects don't necessarily follow the Git convention of a single summary line followed by the details in the commit message, so you might not be able to get output that is as useful as git shortlog. This obviously depends on the policies of the project, though.
I think parsing the output of "svn log" to produce something similar to "git shortlog" should be quite easy.
If you just want counts per user, you could try this quick'n'dirty option:
svn log --xml | grep '<author>' | sed -e 's/<author>\([^<]*\)<\/author>/\1/' | sort | uniq -c
Use svn log with grep count argument
From man page, grep --count -c, --count
Suppress normal output; instead print a count of matching lines for each input file. With the -v, --invert-match option (see below), count non-matching lines.
svn log -v --xml http://www.sourceforge.net/svnroot/ | grep -c '<author>'
精彩评论