#!/bin/sh # # creates a SLOC graph through the revisions # give path to repo a first arg # output is generated in the current directory # requires: git, sloccount, gnuplot # # markus schnalke # 2012-04 tmprepo=sloc-$$ slocdata=sloc-$$-data output=sloc-$$.png if [ $# -ne 1 ] ; then echo "usage: $0 GIT-REPO" >&2 exit 1 fi git clone "$1" "$tmprepo" >/dev/null cd "$tmprepo" for i in `git log | grep ^commit |cut -d' ' -f2| tac` ; do git checkout $i >/dev/null 2>&1 sloc=`sloccount . | awk '/^ansic/{print $2}'` echo "$sloc $i" done | awk '{ print NR, $0 }' >"../$slocdata" gnuplot <