A few weeks ago, Benno asked me if I had a way to use cvs annotate to
work out percentages of code written, and after a short bit of hacking,
there was this:

a=; t=0; cvs ann 2>/dev/null | cut -c15-21 | sort | uniq -c | while read i; do u=`echo 
$i | cut -f2 -d' '`; s=`echo $i | cut -f1 -d' '`; t=$((${t-0} + $s)); echo $t $u $s ; 
done | sort -rn | while read i ; do if [ "x$a" = "x" ]; then a=`echo $i | cut -f1 -d' 
'`; fi ; u=`echo $i | cut -f2 -d' '`; s=`echo $i | cut -f3 -d' '`; s=$(($s * 100)); 
echo $u $(($s / $a)); done

but I was looking at the subversion repo at work today, and wondered
the same thing... so with a bit of mangling here it is:

a=; t=0; find . -type f ! -regex '.*\.svn.*' -exec svn ann {} \; 2>/dev/null | awk 
'{print $2}' | sort | uniq -c | while read i; do u=`echo $i | cut -f2 -d' '`; s=`echo 
$i | cut -f1 -d' '`; t=$((${t-0} + $s)); echo $t $u $s ; done | sort -rn | while read 
i ; do if [ "x$a" = "x" ]; then a=`echo $i | cut -f1 -d' '`; fi ; u=`echo $i | cut -f2 
-d' '`; s=`echo $i | cut -f3 -d' '`; s=$(($s * 100)); echo $u $(($s / $a)); done

Fun, eh? :-)

-- 
[EMAIL PROTECTED]                           http://spacepants.org/jaq.gpg
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to