def parse_gitlog(filename=None):
    results = {}
    commits = {}
    commits_by_contributor = {}

    if not filename or filename == '-':
        fh = sys.stdin
    else:
        fh = open(filename, 'r+')

    commitcount = 0
    for line in fh.readlines():
        line = line.rstrip()
        if line.startswith('commit '):
            new_commit = True
            commitcount += 1
            continue

        if line.startswith('Author:'):
            author = re.match(r'Author:\s+(.*)\s+<(.*)>', line)
            if author:
                email = author.group(2)
            continue

        if line.startswith('Date:'):

            isodate = re.match(r'Date:\s+(.*)', line)
            d = parse_date(isodate.group(1))
            continue

        if len(line) < 2 and new_commit:
            new_commit = False
            key = '{0}-{1}'.format(d.year, str(d.month).zfill(2))

            if key not in results:
                results[key] = []

            if key not in commits:
                commits[key] = 0

            if email not in commits_by_contributor:
                commits_by_contributor[email] = {}

            if key not in commits_by_contributor[email]:
                commits_by_contributor[email][key] = 1
            else:
                commits_by_contributor[email][key] += 1

                if email not in results[key]:
                    results[key].append(email)

                commits[key] += commitcount
                commitcount = 0
    fh.close()
    return (results, commits, commits_by_contributor)
Convert to a Mesh.
dataset/ETHPy150Open saltstack/salt/tests/committer_parser.py/parse_gitlog--crossover with--dataset/ETHPy150Open ASPP/pelita/pelita/layout.py/Layout.as_mesh