Skip to content

SVN Log Parser

The SVN Log Parser turns the log of a Subversion repository into metrics per file: how often it changed, how many people changed it, how old it is and which files change together with it. Merged with code metrics, that shows you the hotspots of the codebase.

Terminal window
cd path/to/working-copy
svn log --verbose > svn.log
ccsh svnlogparser svn.log -o history.cc.json

This writes history.cc.json.gz. Run at the root of a working copy, ccsh analyse reads the svn log itself and merges it with the code metrics.

ParameterDescription
FILEfile to parse
--add-authoradd an array of authors to every file
--silentsuppress command line output during process
-h, --helpdisplays help
-o, --output-file=<outputFile>output File (or empty for stdout)
-nc, --not-compressedsave uncompressed output file
Usage: ccsh svnlogparser [-h] [--add-author] [-nc] [--silent] [-o=<outputFile>]
FILE
MetricDescription
age_in_weeksThe file’s age measured in weeks since creation.
number_of_authorsThe count of distinct authors who have contributed commits.
number_of_commitsThe total commits made to the file.
number_of_renamesHow many times the file has been renamed.
range_of_weeks_with_commitsThe span of weeks during which commits were made.
successive_weeks_with_commitsConsecutive weeks during which the file received commits.
weeks_with_commitsThe number of weeks in which the file was modified.
highly_coupled_filesFiles often modified together with this file (35% overlap or more).
median_coupled_filesThe median number of files modified in tandem with this file.

The parser also writes one edge metric between files:

MetricDescription
temporal_couplingThe degree of temporal coupling between two files (>=35%)

With --add-author, every file also gets the list of its authors’ names (authors). The commit-type metrics of the Git Log Parser, such as feat_commits, exist for git only.

SCMLog formatCommand for log creationtracks renamesignores deleted filessupports code churn
SVNSVN_LOGsvn log --verboseyesyesno

The parser merges a project piped into it with its result, and the merged project keeps the project name of the SVN Log Parser:

Terminal window
ccsh unifiedparser . | ccsh svnlogparser svn.log -o project.cc.json