Play the Git Game

I just wrote a small script that I call “git-winner” that let’s you see how much code you’ve committed vs. other coders on your team. It also looks at commit count. If you’re the highest in commit count and number of lines committed (insertions + deletions), you’re declared the overall winner.

Yeah, not the best metrics, but it’s fun. ;) Here’s the output for Rubinius over the past couple days:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
~/dev/rubinius (master) $ git-winner 01-23-2008
Activity after 01-23-2008

Results for Adam Gardiner:
  # of commits        : 1
  # of lines committed: 14
Results for Benjamin Andresen:
  # of commits        : 1
  # of lines committed: 791
Results for Dirkjan Bussink:
  # of commits        : 3
  # of lines committed: 38
Results for Eero Saynatkari:
  # of commits        : 2
  # of lines committed: 466
Results for Eric Hodel:
  # of commits        : 9
  # of lines committed: 5375
Results for Evan Phoenix:
  # of commits        : 15
  # of lines committed: 30322
Results for Jacob Maine:
  # of commits        : 1
  # of lines committed: 2
Results for Jonas Pfenniger:
  # of commits        : 4
  # of lines committed: 90
Results for Vladimir Sizikov:
  # of commits        : 8
  # of lines committed: 219
Results for Wilson Bilkovich:
  # of commits        : 2
  # of lines committed: 42

Evan Phoenix wins in commit count with 15 commits!
Evan Phoenix wins in number of lines commited with 30322 lines!

Evan is the overall winner!!

Download it here and drop it in your PATH. Then just run it when you’re in any git repo. Defaults to output for the current day, but the first (and only) argument is a date, so modify to suit taste.

I’ve tested it on OS X and Linux (Ubuntu) and the results are the same. Because of the way git-rev-list processes the —author argument (as a regex on the whole author line of the commit), results can be funky in some cases. But for most, it’ll be fine.

The latest version will live in the Caboose git-contrib repo: git://git.caboo.se/git-contrib

Have fun!

Comments