#!/usr/bin/env python
from __future__ import print_function
from __future__ import absolute_import
import shlex
import subprocess

def main():
    args = shlex.split('git log --pretty=format:"%an <%ae>"')
    p = subprocess.Popen(args, stdout=subprocess.PIPE)
    out = p.communicate()[0].decode().split('\n')

    done = set()
    unique = []
    counts = {}
    for line in reversed(out):
        line = line.strip()
        if not len(line): continue

        name, email = line.split(' <')
        name = name.strip()
        email = '<' + email.strip()

        if not name in done:
            done.add(name)
            unique.append(name)

        record = counts.setdefault(name, [0, email])
        record[0] += 1
        if not email in record[1:]:
            record.append(email)


    print('List of contributors ordered by date of the first commit,'
          ' with commit counts:')

    for line in unique:
        record = counts[line]
        print(('%6d %s %s' % (record[0], line, ', '.join(record[1:]))))

if __name__ == '__main__':
    main()

@@ -289,16 +289,23 @@
 .decode(
+'utf-8'
 ).split(
@@ -310,16 +310,16 @@
 t('%5Cn')%0A
-
 %0A    don
@@ -328,16 +328,29 @@
 = set()%0A
+    e2n = %7B%7D%0A
     uniq
@@ -601,16 +601,53 @@
 n done:%0A
+            if email not in e2n:%0A    
         
@@ -681,22 +681,196 @@
     
-unique.append(
+    e2n%5Bemail%5D = name%0A%0A                unique.append(name)%0A%0A            elif name not in counts%5Be2n%5Bemail%5D%5D:%0A                counts%5Be2n%5Bemail%5D%5D.append(name)%0A%0A        name = e2n.get(email, 
 name
@@ -984,16 +984,16 @@
 rd%5B1:%5D:%0A
+
         
@@ -1018,17 +1018,16 @@
 email)%0A%0A
-%0A
     prin

fix script/show_authors.py for unicode, update for several names