photo
Jordan Sissel
geek

Wed, 28 Dec 2005

Watching yourself work

I got bored and wanted to see how many lines of code I had otherwise altered since winter break started.

The actual numbers are:

  • Added: 1617
  • Deleted: 1964
I've deleted a lot more than I have added. This is reasonable considering I've been doing quite a bit of code refactoring and I always end up with smaller code that does more.

I'm sure the method I used wasn't the cleanest or best method to go about finding these numbers, but I wasn't looking to spend more than 5 minutes figuring it out. Here's how I looked those numbers up:

% p4 diff -ds `find ./ | sed -e 's,$,@2005/12/20,'` > changes
% awk 'BEGIN { add = 0; del = 0; chg = 0 }; 
/^add/ { add += $4 }; 
/^deleted/ { del += $4 }; 
/^changed/ { chg += $4 }; 
END { printf "Add/Del/Chg: %d/%d/%d", add, del, chg}' changes

Add/Del/Chg: 326/10/139

% svn diff -r {2005-12-20}:head > diffs
% awk 'BEGIN {add = 0; del = 0}
/^-[^-]/ { add += 1};
/^+[^+]/ { del += 1 };
END { print add" "del}' diffs

1152 1815

Comments: 0 (view comments)
Tags:
Permalink: /productivity/203
posted at: 06:31

Search this site

Navigation

Metadata

Home About Resume My Code (SVN)

Articles

ARP Security Dynamic DNS with DHCP OpenLDAP+Kerberos+SASL PPP over SSH SSH Security: /bin/false Week of Unix Tools Work Efficiency

Projects

fex firefox tabsearch firefox urledit grok keynav liboverride newpsm (FreeBSD) nis2ldap pam_captcha poor man's backup Solaris audio utility xboxproxy xdotool xmlpresenter xpathtool misc scripts

Presentations

Yahoo! Hack Day '06 Unix Essentials Vi/Vim Essentials

Tag Cloud

Calendar

< December 2005 >
SuMoTuWeThFrSa
     1 2 3
4 5 6 7 8 910
11121314151617
18192021222324
25262728293031

Friends

BarCamp Kent Brewster Tantek Çelik John Resig Wesley Shields Tyler Shields

Technorati