Skip to content

Commit

Permalink
Add .mailmap for git shortlog -nse
Browse files Browse the repository at this point in the history
Generated with the command
```
git shortlog -nse | ./make-mailmap.py 'Marco Maggesi <[email protected]>' 'Cosimo Perini <[email protected]>' 'Dimitris Tsementzis <[email protected]>' 'amblaf <[email protected]>' 'Catherine Lelay <[email protected]>' 'Christian Graulund <[email protected]>' 'Christian Graulund <[email protected]>' 'Dominik Kirst <[email protected]>' 'Mike Shulman <[email protected]>' 'Niccolo Veltri <[email protected]>' 'Matthew Weaver <[email protected]>' 'Jason Gross <[email protected]>' 'Jason Gross <[email protected]>' 'Anders Mörtberg <[email protected]>' 'Anders Mörtberg <[email protected]>' > .mailmap
```

using the file
```python
#!/usr/bin/env python3
import sys, re, math

SHORTLOG_REG = re.compile(r'^\s*([0-9]*)\s*([^<]*)<([^>]*)>\s*(.*)$')
EMAIL_REG = re.compile(r'<([^>]*)>')
def update_mapping(mapping, line, counter=0):
    match = SHORTLOG_REG.match(line)
    if match:
        priority, name, email, extra = match.groups()
        if extra.strip():
            print(f'WARNING: Extra {extra!r} on line:\n{line}', file=sys.stderr)
        priority = ((int(priority) if priority else math.inf), -counter)
        name = name.strip()
        line = f'{name} <{email}>'
        candidates = []
        for canonical, v in mapping.items():
            if email.lower() in v['emails'] or name.lower() in v['names']:
                candidates.append((v['priority'], canonical))
        if len(candidates) == 0:
            mapping[line] = {'priority': priority, 'names': set([name.lower()]), 'emails': set([email.lower()]), 'lines': set([line])}
        else:
            candidates = sorted(candidates, reverse=True)
            (_, canonical), candidates = candidates[0], candidates[1:]
            mapping[canonical]['names'].add(name.lower())
            mapping[canonical]['emails'].add(email.lower())
            mapping[canonical]['lines'].add(line)
            for _, other in candidates:
                for k in ('names', 'emails', 'lines'):
                    mapping[canonical][k].update(mapping[other][k])
                del mapping[other]

def mapping_to_lines(mapping):
    max_width = 1 + max(map(len, mapping.keys()))
    for k in sorted(mapping.keys()):
        for v in sorted(mapping[k]['lines']):
            yield ('{0: <%d}{1}' % max_width).format(k, v)

if __name__ == '__main__':
    mapping = {}
    for i, args in enumerate(sys.argv[1:]):
        update_mapping(mapping, args, counter=i)
    for i, line in enumerate(sys.stdin.readlines()):
        update_mapping(mapping, line, counter=i)
    print('\n'.join(mapping_to_lines(mapping)))
```

The arguments passed on the command line are the places where I overrode the rule of 'use the name and email associated to the most commits'.
  • Loading branch information
JasonGross committed Oct 2, 2020
1 parent 35dd92d commit 3d32c15
Showing 1 changed file with 97 additions and 0 deletions.
97 changes: 97 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
## This file allows joining different accounts of a single person.
## Cf for instance: git shortlog -nse. More details via: man git shortlog

# having the same name <email> name <email> on a line will fix capitalization
Alex Kavvos <[email protected]> Alex Kavvos <[email protected]>
Alex Kavvos <[email protected]> Alex Kavvos <[email protected]>
Ambroise <[email protected]> Ambroise <[email protected]>
Ambroise <[email protected]> Jack <[email protected]>
Ambroise Lafont <[email protected]> Ambroise Lafont <[email protected]>
Anders Mörtberg <[email protected]> Anders <[email protected]>
Anders Mörtberg <[email protected]> Anders Mörtberg <[email protected]>
Anders Mörtberg <[email protected]> Anders Mörtberg <[email protected]>
Anders Mörtberg <[email protected]> Anders Mörtberg <[email protected]>
Anders Mörtberg <[email protected]> Anders Mörtberg <[email protected]>
Anders Mörtberg <[email protected]> Hoi Nguyen <[email protected]>
Anders Mörtberg <[email protected]> anders mortberg <[email protected]>
Anthony Bordg <[email protected]> Anthony Bordg <[email protected]>
Auke Booij <[email protected]> Auke Booij <[email protected]>
Benedikt Ahrens <[email protected]> Benedikt Ahrens <[email protected]>
Benedikt Ahrens <[email protected]> Benedikt Ahrens <[email protected]>
Benedikt Ahrens <[email protected]> benediktahrens <[email protected]>
Catherine Lelay <[email protected]> Catherine Lelay <[email protected]>
Catherine Lelay <[email protected]> Catherine Lelay <[email protected]>
Catherine Lelay <[email protected]> Catherine LelayC <[email protected]>
Catherine Lelay <[email protected]> cathlelay <[email protected]>
Christian Graulund <[email protected]> Chgrau <[email protected]>
Christian Graulund <[email protected]> Christian Graulund <[email protected]>
Christian Graulund <[email protected]> Christian Graulund <[email protected]>
Christian Graulund <[email protected]> Christian Graulund <[email protected]>
Christian Graulund <[email protected]> Christian Uldal Graulund <[email protected]>
Cosimo Perini <[email protected]> Cosimo <[email protected]>
Cosimo Perini <[email protected]> Cosimo Perini <[email protected]>
Cosimo Perini <[email protected]> Cosimo Perini <[email protected]>
Dan Frumin <[email protected]> Dan Frumin <[email protected]>
Daniel R. Grayson <[email protected]> Daniel R. Grayson <[email protected]>
Daniel R. Grayson <[email protected]> Daniel R. Grayson <[email protected]>
Dimitris Tsementzis <[email protected]> Dimitris Tsementzis <[email protected]>
Dimitris Tsementzis <[email protected]> Unknown <[email protected]>
Dominik Kirst <[email protected]> Dominik Kirst <[email protected]>
Dominik Kirst <[email protected]> Dominik Kirst <[email protected]>
Dominik Kirst <[email protected]> dominik-kirst <[email protected]>
Elisabeth Bonnevier <[email protected]> Elisabeth Bonnevier <[email protected]>
Emil Skoeldberg <[email protected]> Emil Skoeldberg <[email protected]>
Emilio Jesus Gallego Arias <[email protected]> Emilio Jesus Gallego Arias <[email protected]>
Enrico Tassi <[email protected]> Enrico Tassi <[email protected]>
Enrico Tassi <[email protected]> Enrico Tassi <[email protected]>
Felix Rech <[email protected]> Felix Rech <[email protected]>
Floris van Doorn <[email protected]> Floris van Doorn <[email protected]>
Gaëtan Gilbert <[email protected]> Gaëtan Gilbert <[email protected]>
Hichem Saghrouni <[email protected]> Hichem Saghrouni <[email protected]>
Hichem Saghrouni <[email protected]> Marmann <[email protected]>
Hugo Herbelin <[email protected]> Hugo Herbelin <[email protected]>
Jannis Limperg <[email protected]> Jannis Limperg <[email protected]>
Jason Gross <[email protected]> Jason Gross <[email protected]>
Jason Gross <[email protected]> Jason Gross <[email protected]>
Joseph Helfer <[email protected]> Joseph Helfer <[email protected]>
Karl Palmskog <[email protected]> Karl Palmskog <[email protected]>
Langston Barrett <[email protected]> Langston Barrett <[email protected]>
Luis Scoccola <[email protected]> Luis Scoccola <[email protected]>
Marco Maggesi <[email protected]> Marco Maggesi <[email protected]>
Marco Maggesi <[email protected]> Marco Maggesi <[email protected]>
Marcus Aloysius Bezem <[email protected]> Marcus Aloysius Bezem <[email protected]>
Mario Román <[email protected]> Mario Román <[email protected]>
Mario Román <[email protected]> Mario Román <[email protected]>
Matthew Weaver <[email protected]> Matthew Weaver <[email protected]>
Matthew Weaver <[email protected]> mweav <[email protected]>
Matthew Weaver <[email protected]> mweav <[email protected]>
Maxime Dénès <[email protected]> Maxime Dénès <[email protected]>
Michael A. Warren <[email protected]> Michael A. Warren <[email protected]>
Mike Shulman <[email protected]> Mike Shulman <[email protected]>
Mike Shulman <[email protected]> mikeshulman <[email protected]>
Mitchell Riley <[email protected]> Mitchell Riley <[email protected]>
N. Raghavendra <[email protected]> N. Raghavendra <[email protected]>
Niccolo Veltri <[email protected]> Niccolo Veltri <[email protected]>
Niccolo Veltri <[email protected]> niccoloveltri <[email protected]>
Niels van der Weide <[email protected]> Niels van der Weide <[email protected]>
Niels van der Weide <[email protected]> Niels van der Weide <[email protected]>
Nikolai Kudasov <[email protected]> Nikolai Kudasov <[email protected]>
Peter LeFanu Lumsdaine <[email protected]> Peter LeFanu Lumsdaine <[email protected]>
Ralph Matthes <[email protected]> Ralph Matthes <[email protected]>
Ralph Matthes <[email protected]> Ralph Matthes <[email protected]>
Ralph Matthes <[email protected]> Ralph Matthes <[email protected]>
Ralph Matthes <[email protected]> rmatthes <[email protected]>
Tamara von Glehn <[email protected]> Tamara von Glehn <[email protected]>
Théo Zimmermann <[email protected]> Théo Zimmermann <[email protected]>
Tom de Jong <[email protected]> Tom de Jong <[email protected]>
Tomi Pannila <[email protected]> Tomi Pannila <[email protected]>
Tony Beta Lambda <[email protected]> Tony Beta Lambda <[email protected]>
Vincent Laporte <[email protected]> Vincent Laporte <[email protected]>
Vladimir Voevodsky <[email protected]> Vladimir Voevodsky <vladimir @ ias . edu>
Vladimir Voevodsky <[email protected]> Vladimir Voevodsky <[email protected]>
amblaf <[email protected]> amblaf <[email protected]>
amblaf <[email protected]> amblaf <[email protected]>
bcldoherty <[email protected]> bcldoherty <[email protected]>
sspeight93 <[email protected]> sspeight93 <[email protected]>
tamaravonglehn <[email protected]> tamaravonglehn <[email protected]>
varkor <[email protected]> varkor <[email protected]>

0 comments on commit 3d32c15

Please sign in to comment.