diff options
author | Rich Trott <rtrott@gmail.com> | 2021-07-18 16:20:23 -0700 |
---|---|---|
committer | Beth Griggs <bgriggs@redhat.com> | 2021-07-29 11:56:52 +0100 |
commit | 7570f998df8b5c63bb48f5fee9d5442b68910267 (patch) | |
tree | 2b665a46854d5ec9496f1e716ce89b5606158992 /tools/update-authors.js | |
parent | 5c11a0279dce2432403da5caa560daa1fc2a6cce (diff) | |
download | node-new-7570f998df8b5c63bb48f5fee9d5442b68910267.tar.gz |
tools: email matchin is case insensitive for .mailmap
PR-URL: https://github.com/nodejs/node/pull/39430
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'tools/update-authors.js')
-rwxr-xr-x | tools/update-authors.js | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/tools/update-authors.js b/tools/update-authors.js index 312f253c48..f9797b1998 100755 --- a/tools/update-authors.js +++ b/tools/update-authors.js @@ -41,19 +41,21 @@ const mailmap = new CaseIndifferentMap(); let match; // Replaced Name <original@example.com> if (match = line.match(/^([^<]+)\s+(<[^>]+>)$/)) { - mailmap.set(match[2], { author: match[1] }); + mailmap.set(match[2].toLowerCase(), { + author: match[1], email: match[2] + }); // <replaced@example.com> <original@example.com> } else if (match = line.match(/^<([^>]+)>\s+(<[^>]+>)$/)) { - mailmap.set(match[2], { email: match[1] }); + mailmap.set(match[2].toLowerCase(), { email: match[1] }); // Replaced Name <replaced@example.com> <original@example.com> } else if (match = line.match(/^([^<]+)\s+(<[^>]+>)\s+(<[^>]+>)$/)) { - mailmap.set(match[3], { + mailmap.set(match[3].toLowerCase(), { author: match[1], email: match[2] }); // Replaced Name <replaced@example.com> Original Name <original@example.com> } else if (match = line.match(/^([^<]+)\s+(<[^>]+>)\s+([^<]+)\s+(<[^>]+>)$/)) { - mailmap.set(match[3] + '\0' + match[4], { + mailmap.set(match[3] + '\0' + match[4].toLowerCase(), { author: match[1], email: match[2] }); } else { @@ -75,8 +77,10 @@ rl.on('line', (line) => { if (!match) return; let { author, email } = match.groups; + const emailLower = email.toLowerCase(); - const replacement = mailmap.get(author + '\0' + email) || mailmap.get(email); + const replacement = + mailmap.get(author + '\0' + emailLower) || mailmap.get(emailLower); if (replacement) { ({ author, email } = { author, email, ...replacement }); } |