Skip to content

Commit

Permalink
A more useful committer score card
Browse files Browse the repository at this point in the history
Now with aliases for anyone who hit the top 20 list of the last year,
six months, and twelve weeks.

Still needs some optparsey niceities, but it's good enough for an
intial push to GitHub.
  • Loading branch information
todb committed Dec 17, 2012
1 parent bd4e00e commit aff6169
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 12 deletions.
65 changes: 56 additions & 9 deletions .mailmap
Original file line number Diff line number Diff line change
@@ -1,10 +1,57 @@
wchen-r7 <wchen-r7@github> sinn3r <msfsinn3r@gmail.com>
todb-r7 <todb-r7@github> Tod Beardsley <todb@metasploit.com>
jvazquez-r7 <jvazquez-r7@github> jvazquez-r7 <juan.vazquez@metasploit.com>
hmoore-r7 <hmoore-r7@github> HD Moore <hd_moore@rapid7.com>
jlee-r7 <jlee-r7@github> James Lee <egypt@metasploit.com>
dmaloney-r7 <dmalone-r7@github> David Maloney <DMaloney@rapid7.com>
joev-r7 <joev-r7@github> Joe Vennix <Joe_Vennix@rapid7.com>
bturner-r7 <bturner-r7@github> Brandon Turner <brandon_turner@rapid7.com>
ecarey-r7 <ecarey-r7@github> Erran Carey <e@ipwnstuff.com>
wchen-r7 <wchen-r7@github> sinn3r <msfsinn3r@gmail.com> # aka sinn3r
wchen-r7 <wchen-r7@github> Wei Chen <Wei_Chen@rapid7.com>
wchen-r7 <wchen-r7@github> sinn3r <wei_chen@rapid7.com>
todb-r7 <todb-r7@github> Tod Beardsley <todb@metasploit.com>
jvazquez-r7 <jvazquez-r7@github> jvazquez-r7 <juan.vazquez@metasploit.com>
hmoore-r7 <hmoore-r7@github> HD Moore <hd_moore@rapid7.com>
jlee-r7 <jlee-r7@github> James Lee <egypt@metasploit.com> # aka egypt
jlee-r7 <jlee-r7@github> James Lee <James_Lee@rapid7.com>
dmaloney-r7 <dmaloney-r7@github> David Maloney <DMaloney@rapid7.com> # aka TheLightCosine
dmaloney-r7 <dmaloney-r7@github> David Maloney <David_Maloney@rapid7.com>
joev-r7 <joev-r7@github> Joe Vennix <Joe_Vennix@rapid7.com>
bturner-r7 <bturner-r7@github> Brandon Turner <brandon_turner@rapid7.com>
ecarey-r7 <ecarey-r7@github> Erran Carey <e@ipwnstuff.com>
limhoff-r7 <limhoff-r7@github> Luke Imhoff <luke_imhoff@rapid7.com>
todb-r7 <todb-r7@github> Tod Beardsley <tod_beardsley@rapid7.com>
tasos-r7 <tasos-r7@github> Tasos Laskos <Tasos_Laskos@rapid7.com>

# Above this line are current Rapid7 employees
# Below this line are volunteers, former, and potential Rapid7 employees
# who, at one time or another, had some largeish number of commits landed
# on rapid7/metasploit-framework master branch It should be refreshed periodically

Meatballs1 <Meatballs1@github> Meatballs <eat_meatballs@hotmail.co.uk>
Meatballs1 <Meatballs1@github> Meatballs1 <eat_meatballs@hotmail.co.uk>
Meatballs1 <Meatballs1@github> Meatballs1 <campbell_ab@hotmail.com>
jduck <jduck@github> Joshua Drake <github.jdrake@qoop.org>
jcran <jcran@github> Jonathan Cran <jcran@rapid7.com>
jcran <jcran@github> Jonathan Cran <jcran@0x0e.org>
bannedit <bannedit@github> David Rude <bannedit0@gmail.com>
darkoperator <darkoperator@github> Carlos Perez <carlos_perez@darkoperator.com>
scriptjunkie <scriptjunkie@github> Matt Weeks <scriptjunkie@scriptjunkie.us>
skape <skape@???> Matt Miller <mmiller@hick.org>
ceballosm <ceballosm@github> Mario Ceballos <mc@metasploit.com>
swtornio <swtornio@github> Steve Tornio <swtornio@gmail.com>
kris <kris@???> kris <>
spoonm <spoonm@github> Spoon M <spoonm@gmail.com>
fab <fab@???> fab <> # fab at revhosts.net (Fabrice MOURRON)
efraintorres <efraintorres@github> efraintorres <etlownoise@gmail.com>
efraintorres <efraintorres@github> et <>
r3dy <r3dy@github> Royce Davis <r3dy@Royces-MacBook-Pro.local>
r3dy <r3dy@github> Royce Davis <royce.e.davis@gmail.com>
mubix <mubix@github> Rob Fuller <jd.mubix@gmail.com>
nmonkee <nmonkee@github> nmonkee <dave@northern-monkee.co.uk>
rsmudge <rsmudge@github> Raphael Mudge <rsmudge@gmail.com> # Aka `butane
m-1-k-3 <m-1-k-3@github> m-1-k-3 <michael.messner@integralis.com>
kost <kost@github> Vlatko Kosturjak <kost@linux.hr>
ohdae <ohdae@github> ohdae <bindshell@live.com>
schierlm <schierlm@github> Michael Schierl <schierlm@gmx.de> # Aka mihi
corelanc0d3er <corelanc0d3er@github> Peter Van Eeckhoutte (corelanc0d3r) <peter.ve@corelan.be>
corelanc0d3er <corelanc0d3er@github> corelanc0d3r <peter.ve@corelan.be>
kernelsmith <kernelsmith@github> Joshua Smith <kernelsmith@kernelsmith.com>
kernelsmith <kernelsmith@github> kernelsmith <kernelsmith@kernelsmith>
h0ng10 <h0ng10@github> h0ng10 <hansmartin.muench@googlemail.com>
nullbind <nullbind@github> nullbind <scott.sutherland@nullbind.com>
nevdull77 <nevdull77@github> Patrik Karlsson <patrik@cqure.net>
jgor <jgor@github> jgor <jgor@indiecom.org>
ChrisJohnRiley <ChrisJohnRiley@github> Chris John Riley <chris.riley@c22.cc>
44 changes: 41 additions & 3 deletions tools/commit_scorecard.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
#!/usr/bin/env ruby

# The commit_scorecard is a way to tell who's been active over the last
# given period. It's of course, quite coarse -- someone with 10 commits in a day
# may or may not be more productive than someone with 3, but over long enough
# periods, it's an okay metric to measure involvement with the project, since
# large and small commits will tend to average out.
#
# Note that this includes merge commits by default (which usually means at least
# code review happened, so it's still a measure of work). You can get different
# stats by ignoring merge commits, once option parsing is implemented.
#
# Usage: ./commit_scorecard.rb 2011-01-01 | head -10 # Since a particular date
# ./commit_scorecard.rb 1y | head -10 # Last year
# ./commit_scorecard.rb 6m | head -10 # Last six months
# ./commit_scorecard.rb 12w | head -10 # Last twelve weeks
# ./commit_scorecard.rb 100d | head -10 # Last hundred days
#
#
# History with colors and e-mail addresses (respecting .mailmap):
# git log --pretty=format:"%C(white)%ad %C(yellow)%h %Cblue'%aN' <%aE> %Cgreen%f%Creset" --date=short

Expand All @@ -10,11 +27,32 @@ class GitLogLine < Struct.new(:date, :hash, :author, :message)
@recent_history = []
@commits_by_author = {}

cutoff_date = "2012-06-16"
def parse_date(date)
case date
when /([0-9]+)y(ear)?s?/
seconds = $1.to_i* (60*60*24*365.25)
calc_date = (Time.now - seconds).strftime("%Y-%m-%d")
when /([0-9]+)m(onth)?s?/
seconds = $1.to_i* (60*60*24*(365.25 / 12))
calc_date = (Time.now - seconds).strftime("%Y-%m-%d")
when /([0-9]+)w(eek)?s?/
seconds = $1.to_i* (60*60*24*7)
calc_date = (Time.now - seconds).strftime("%Y-%m-%d")
when /([0-9]+)d(ay)?s?/
seconds = $1.to_i* (60*60*24)
calc_date = (Time.now - seconds).strftime("%Y-%m-%d")
else
calc_date = Time.new(date).strftime("%Y-%m-%d")
end
end

date = ARGV[0] || "2005-03-22" # A day before the first SVN commit.
calc_date = parse_date(date)


@history.each_line do |line|
parsed_line = line.match(/^([^\s+]+)\s(.{7,})\s'(.*)'\s(.*)[\r\n]*$/)
break if cutoff_date == parsed_line[1]
break if calc_date == parsed_line[1]
@recent_history << GitLogLine.new(*parsed_line[1,4])
end

Expand All @@ -23,7 +61,7 @@ class GitLogLine < Struct.new(:date, :hash, :author, :message)
@commits_by_author[logline.author] << logline.message
end

puts "Commits since #{cutoff_date}"
puts "Commits since #{calc_date}"
puts "-" * 50

@commits_by_author.sort_by {|k,v| v.size}.reverse.each do |k,v|
Expand Down

0 comments on commit aff6169

Please sign in to comment.