Created
November 17, 2008 07:10
-
-
Save dustin/25683 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
A script to tell you who actually wrote your current codebase. | |
Usage: | |
git ls-files | xargs -n 1 git annotate | ./who-wrote-this.py | |
Copyright (c) 2008 Dustin Sallings <dustin@spy.net> | |
""" | |
import fileinput | |
total_lines=0 | |
authors={} | |
for l in fileinput.input(): | |
total_lines += 1 | |
x=l.split("\t", 3)[1] | |
a=x[1:].strip() | |
authors[a] = authors.get(a, 0) + 1 | |
for n, a in sorted([(v,k) for k,v in authors.iteritems()], reverse=True): | |
print a, n |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment