How many lines of code have been committed to my SVN repository?

2.8k Views Asked by At

How could I check how many lines of code have been committed to my SVN repository across all commits?

1

There are 1 best solutions below

0
On

If you don't want to use statsvn.org, what you need to do is get the files that was modified in the last N minutes and then run wc -l, for example:

#!/bin/bash

LINES=0
SVNROOT=/path/to/svn/repo
MMIN=-5

for f in `find $SVNROOT -type f -mmin $MMIN`; do
    FILE_LINES=$(cat $f | wc -l)
    LINES=$((LINES + FILE_LINES))
done

echo "LINES COMMITTED IN THE LAST $MMIN MINUTES: $LINES"