Search this site

Metadata

Articles

Projects

Presentations

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


0 responses to 'Watching yourself work'

Showing last 0 comments... (Click here to view all comments)


Leave a reply

You need javascript enabled to use this form. Anti-spam efforts ongoing. Also, if the comment doesn't show up, it's because the form expired. Go back and copy your comment, reload the form, and resubmit. Apologies if this is a hassle, I'm just playing with antispam methods right now. If this insists on not working, please email me about it.

Name (required)
E-mail (optional, if you want me to be able to email you back)
URL (also optional)
Comment: