Skip to content

Instantly share code, notes, and snippets.

@rom1504
Last active August 29, 2015 14:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rom1504/9f9bcc843343159ed50a to your computer and use it in GitHub Desktop.
Save rom1504/9f9bcc843343159ed50a to your computer and use it in GitHub Desktop.
git stats
if [[ $# -ne 2 ]]
then
echo "usage : $0 <outputFile> <repo>"
exit 1
fi
outputFile=$1
repo=$2
rm $outputFile
cd $repo
git checkout master
for i in $(git rev-list HEAD)
do
git checkout $i
fileList=`find -name "*.js"`
if [ "$fileList" = "" ]
then
lineCount=0
fileCount=0
else
lineCount=`cat $fileList | wc -l`
fileCount=`echo "$fileList" |wc -l`
fi
echo -e "$i\t$lineCount\t$fileCount" >> $outputFile
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment