Dumbing Things Up

i915.ko authors, by the numbers

written by ben on 2013-05-12

Here is the top 10 from the very latest drm-intel-nightly

>./count_i915.py drivers/gpu/drm/i915/

*total lines counted: 67417 (compare with git ls-files -- ./drivers/gpu/drm/i915/ \| xargs wc -l)
('Jesse Barnes', 16255),
('Chris Wilson', 13174),
('Daniel Vetter', 11066),
('Eugeni Dodonov', 3636),
('Paulo Zanoni', 3434),
('Ben Widawsky', 2935),
('Eric Anholt', 2176),
('Keith Packard', 1773),
('Zhenyu Wang', 1703),
('Ville Syrjälä', 1130)

And here is the slightly better than one-off script I used:

#!/usr/bin/env python3
import sys
import os
import subprocess
import re
import collections
import pprint

count = collections.Counter()
p = re.compile(r'.+ \(([\w\W]+) [0-9]{4}-[0-9]{2}-[0-9]{2}.*', re.UNICODE)

path=sys.argv[1]
git_path=os.path.dirname(sys.argv[0]) + "/" + path
os.chdir(git_path)
for file in os.listdir(os.getcwd()):
        blame = subprocess.check_output(["git", "blame", "-w", "--abbrev=10", file],
                        stderr=subprocess.STDOUT)
        for line in blame.splitlines():
                m = p.match(str(line, 'utf-8'))
                name = str(m.group(1))
                name = name.rstrip()
                count[name] += 1

print("total lines counted: " + str(sum(count.values())) + " (compare with git ls-files -- " + git_path + " | xargs wc -l)")
pprint.pprint(count.most_common(10))