How to export the Subversion log to spreadsheet

Chris West came up with a pretty simple and yet effective solution: http://gotochriswest.com/blog/2012/10/02/svn-log-to-csv-converter/ Actually the page seems to be moved here: http://cwestblog.com/2012/10/02/svn-log-to-csv-converter/

He listed two solutions on that page. The first is a Java program which will output a CSV. The second is a JSBin page which will convert the pasted SVN log into a CSV.


  1. Use the following Subversion command to create an xml file out of the repository's log:

    svn log -v --xml > repository_log.xml

  2. Import the xml file into an Excel spreadsheet (not sure if it will work with LibreOffice/OpenOffice), e.g. from cmd:

    start excel repository_log.xml

  3. You can then save it as a spreadsheet.

That's it!


Since you are using TortoiseSVN and are thus on Windows, a straightforward way to do this is with PowerShell. Start with this function to convert svn log data to PowerShell objects:

Function Get-SvnLogData()
{
    ([xml](svn log -v --xml)).log.logentry | % {
        $nestedEntry = $_
        $_.paths.path | % {
            $path = $_
            $nestedEntry | Select-Object -Property `
                Author, `
                @{n='Revision'; e={([int]$_.Revision)}}, `
                @{n='Date';     e={Get-Date $_.Date  }}, `
                @{n='Action';   e={$path.action      }}, `
                @{n='Path';     e={$path.InnerText   }}`
        }
    }
}

The default output is a list, e.g.:

author   : smith
Revision : 29091
Date     : 6/26/2012 7:30:44 AM
Action   : M
Path     : /Utility/trunk/Distribution/file1.txt

author   : jones
Revision : 28987
Date     : 6/21/2012 3:56:51 PM
Action   : M
Path     : /Utility/trunk/Distribution/file2.txt

author   : msorens
Revision : 28934
Date     : 6/21/2012 8:22:17 AM
Action   : M
Path     : /Utility/trunk/Distribution/file3.txt

author   : jones
Revision : 28835
Date     : 6/19/2012 8:56:08 AM
Action   : A
Path     : /Utility/trunk/DAL/stuff.txt
. . .

With this command, however...

Get-SvnLogData | Format-Table -AutoSize

...you can tell PowerShell to give you a table instead of a list, e.g.:

author     Revision Date                   Action Path
------     -------- ----                   ------ ----
smith         29091 6/26/2012 7:30:44 AM   M      /Utility/trunk/Distribution/file1.txt
jones         28987 6/21/2012 3:56:51 PM   M      /Utility/trunk/Distribution/file2.txt
msorens       28934 6/21/2012 8:22:17 AM   M      /Utility/trunk/Distribution/file3.txt
jones         28835 6/19/2012 8:56:08 AM   A      /Utility/trunk/DAL/stuff.txt
. . .

And to actually answer your question :-) you can just as easily convert the output to CSV and send it to a file with a command like this:

Get-SvnLogData | Export-Csv -Path temp.csv

Double-clicking on the resultant file opens it up in Excel:

SVN to Excel