Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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