This one time, at band camp, Robert Collins wrote:
>On Tue, 2004-02-24 at 14:06, Jamie Wilkinson wrote:
>> 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? :-)
>
>Pity it's completely wrong.
>
>How? Thats an exercise for the reader. Hint: your script does what you
>intended it to do, but the oresult is /not/ LOC per person.

check the manpage for the above command, you'll find that it never
claims to output LOC per person.  therefore it's completely right.  QED.

P.S.  your (and Micksa's) email clients are broken.

-- 
[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