Skip to content

Commit

Permalink
tools: make mailmap processing for author list case-insensitive
Browse files Browse the repository at this point in the history
This is to accommodate Myles Borins otherwise ending up with
multiple entries due to different casing in the email 🙂

PR-URL: nodejs#29608
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: Yongsheng Zhang <[email protected]>
Reviewed-By: Saúl Ibarra Corretgé <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
addaleax authored and Trott committed Sep 25, 2019
1 parent 7899a96 commit f9d026d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tools/update-authors.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ const path = require('path');
const fs = require('fs');
const readline = require('readline');

class CaseIndifferentMap {
_map = new Map();

get(key) { return this._map.get(key.toLowerCase()); }
set(key, value) { return this._map.set(key.toLowerCase(), value); }
}

const log = spawn(
'git',
// Inspect author name/email and body.
Expand All @@ -23,7 +30,7 @@ else

output.write('# Authors ordered by first contribution.\n\n');

const mailmap = new Map();
const mailmap = new CaseIndifferentMap();
{
const lines = fs.readFileSync(path.resolve(__dirname, '../', '.mailmap'),
{ encoding: 'utf8' }).split('\n');
Expand Down

0 comments on commit f9d026d

Please sign in to comment.