Mārtiņš Bonders
Mārtiņš Bonders

Reputation: 1

How to include Subversion user commit line statistic using svn log --xml export?

I am using command "svn log --xml -r {2017-01-01}:{2017-09-01} > logfile.xml" to export SVN log data, but when i use --xml switch, there are no commit line information included. I need XML format for next data transformations. Is there any way to include commit line statistic information in XML format? Because i need information about every user with commit count and commit line count.

Upvotes: 0

Views: 74

Answers (1)

alroc
alroc

Reputation: 28174

The output of svn log (XML or otherwise) does not include this information in the first place. You can get the timestamp, revision number, author, and the names of the path(s) modified.

To get the number of lines changed in a commit, you would need to perform a diff between each revision and the previous one. But that breaks down when you consider:

  • Revisions where only properties were changed
  • Revisions where entire files were added, removed or relocated
  • Revisions where no functionality was changed, only formatting/whitespace
  • Revisions containing binary files (and therefore no "lines" to be changed in the first place)
  • Revisions with large amounts of refactoring - if someone replaces large amounts of code with a more concise algorithm or a call to an existing library/function, what does that negative 2000 lines of code really mean?

I have difficulty envisioning a situation where reporting on the number of lines of code changed would be a valid and useful metric.

Upvotes: 1

Related Questions