Search code examples
svnversion-controlstatisticschangelog

Find most modified file extensions in SVN repository


Given a SVN repository url how to find out which file extensions are the most touched.

Essentially I want to compare how much changes are done in JS versus C# code.

Thanks for the ideas.


Solution

  • I came up with this (extension is anything after last dot, ignore paths where there is no dot at all):

    svn log $url -v | grep '^   M \|^   A \|^   D \|^   R ' | grep '\.' | awk -F . '{print $NF}' | sed 's/:.*$//' | sort | uniq -c | sort -bgr
    

    Example output (limited to 5 checkins):

    svn log http://svn.code.sf.net/p/codeblocks/code/trunk/ -v --limit 5 | grep '^   M \|^   A \|^   D \|^   R ' | grep '\.' | awk -F . '{print $NF}' | sed 's/:.*$//' | sort | uniq -c | sort -bgr
         20 xpm
         20 bmp
         19 h
         19 cpp
         16 cbp
          7 am
          4 xml
          2 wxs
          2 rc
          2 in
          1 xrc
          1 workspace
          1 m4
          1 ac