From 6ca7e39a2f963379a98da17c9deaf5c8093afb1b Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Sun, 9 Sep 2018 13:07:52 +0200 Subject: [PATCH 1/4] tools: implement update-authors in JS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the previous Perl script with a Node.js variant that explicitly supports `Author:` and, in particular, GitHub’s standard `Co-authored-by:` metadata tags. --- tools/update-authors.js | 49 +++++++++++++++++++++++++++++++++++++++++ tools/update-authors.sh | 22 ------------------ 2 files changed, 49 insertions(+), 22 deletions(-) create mode 100755 tools/update-authors.js delete mode 100755 tools/update-authors.sh diff --git a/tools/update-authors.js b/tools/update-authors.js new file mode 100755 index 00000000000000..43b8235f940fc1 --- /dev/null +++ b/tools/update-authors.js @@ -0,0 +1,49 @@ +#!/usr/bin/env node +// Usage: tools/update-author.js [--dry] +// Passing --dry will redirect output to stdout rather than write to 'AUTHORS'. +'use strict'; +const { spawn } = require('child_process'); +const fs = require('fs'); +const readline = require('readline'); + +const log = spawn( + 'git', + // Inspect author name/email and body. + ['log', '--reverse', '--format=Author: %aN <%aE>\n%b'], { + stdio: ['inherit', 'pipe', 'inherit'] + }); +const rl = readline.createInterface({ input: log.stdout }); + +let output; +if (process.argv.includes('--dry')) + output = process.stdout; +else + output = fs.createWriteStream('AUTHORS'); + +output.write('# Authors ordered by first contribution.\n\n'); + +const seen = new Set(); + +// Support regular git author metadata, as well as `Author:` and +// `Co-authored-by:` in the message body. Both have been used in the past +// to indicate multiple authors per commit, with the latter standardized +// by GitHub now. +const authorRe = /(?:^Author:|^Co-authored-by:)\s+([^<]+)\s+(<[^>]+>)/i; +rl.on('line', (line) => { + const match = line.match(authorRe); + if (!match) return; + + const [ _, author, email ] = match; // eslint-disable-line no-unused-vars + if (seen.has(email) || + /@chromium\.org/.test(email) || + email === '') { + return; + } + + seen.add(email); + output.write(`${author} ${email}\n`); +}); + +rl.on('close', () => { + output.end('\n# Generated by tools/update-authors.js\n'); +}); diff --git a/tools/update-authors.sh b/tools/update-authors.sh deleted file mode 100755 index d07d9c9ff73c43..00000000000000 --- a/tools/update-authors.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -git log --reverse --format='%aN <%aE>' | perl -we ' - -BEGIN { - %seen = (), @authors = (); -} - -while (<>) { - next if $seen{$_}; - next if /\@chromium.org/; - next if //; - $seen{$_} = push @authors, $_; -} - -END { - print "# Authors ordered by first contribution.\n"; - print "\n", @authors, "\n"; - print "# Generated by tools/update-authors.sh\n"; -} - -' > AUTHORS From 0d3ad1d7d806015d31ca0119bbdce46664dbb463 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Sun, 9 Sep 2018 13:09:34 +0200 Subject: [PATCH 2/4] doc: update AUTHORS list This includes some re-ordering due to the newly added support for co-authored commits. --- .mailmap | 4 +++ AUTHORS | 108 ++++++++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 99 insertions(+), 13 deletions(-) diff --git a/.mailmap b/.mailmap index 0fffffad9eaf34..679ca986eec6c7 100644 --- a/.mailmap +++ b/.mailmap @@ -131,6 +131,7 @@ Gabriel de Perthuis Gareth Ellis Garwah Lam Geoffrey Bugaisky gbugaisky +Gerhard Stoebich Gibson Fahnestock Gil Pedersen Graham Fairweather Xotic750 @@ -204,6 +205,7 @@ Jérémy Lal Juan Sebastian Velez Posada Kai Sasaki Lewuathe Karl Skomski +Kat Marchán Kathy Truong k3kathy Kazuyuki Yamada Keith M Wesolowski @@ -237,6 +239,7 @@ Matheus Marchini Matheus Marchini Matt Lang matt-in-a-hat Matt Reed matthewreed26 +Matteo Collina Matthias Bastian piepmatz Mathias Buus Mathias Pettersson @@ -363,6 +366,7 @@ Tadashi SAWADA Takahiro ANDO Tarun Batra Tarun Ted Young +Teppei Sato Thomas Hunter II Thomas Lee Thomas Reggi diff --git a/AUTHORS b/AUTHORS index db2e74f250823e..da453e0f27e688 100644 --- a/AUTHORS +++ b/AUTHORS @@ -650,7 +650,7 @@ Micleusanu Nicu Alejandro Oviedo Garcia Ben Burns Julian Duque -teppeis +Teppei Sato Rudi Cilibrasi Tim Ruffles CGavrila @@ -754,14 +754,14 @@ Felipe Batista Rebecca Turner Tyler Anton João Reis -Kat Marchán +Kat Marchán Ryan Petschek Pierre Inglebert Ivan Yan Sangmin Yoon Mark Plomer Phillip Johnsen -Matteo Collina +Matteo Collina jomo Gireesh Punathil Lucien Greathouse @@ -1432,23 +1432,25 @@ Ahmad Nassri Tom Atkinson Tobias Nießen Joseph Gentle +Arunesh Chandra +Gabriel Schulhof +Ian Halliday +Sampson Gao +Taylor Woll Zero King Raphael Okon JR McEntee Lovell Fuller Jason Marsh Vinay Hiremath -Gabriel Schulhof alejandro dave-k Steven Uppinder Chugh Karl Cheng -Taylor Woll Tarun Batra Nao YONASHIRO Christopher Luke -Sampson Gao John Paul Bamberg Cody Deckard Fabio Campinho @@ -1488,7 +1490,7 @@ Madara Uchiha Gil Tayar Glenn Schlereth Artur G Vieira -Flarna +Gerhard Stoebich Sreepurna Jasti Rafael Fragoso Andrei Cioromila @@ -1658,6 +1660,8 @@ Piotr Mionskowski Cyril Lakech Eduard Bondarenko Adina Shanholtz +Guy Bedford +Jan Krems Miguel Martins Yury Popov George Bezerra @@ -1670,7 +1674,6 @@ Alex Gresnel <31708810+agresnel@users.noreply.github.com> Will Young Martijn Schrage Halil İbrahim Şener -Guy Bedford Antoine Amara Mani Maghsoudlou Bartek Szczepański @@ -1884,7 +1887,6 @@ Ashish Kaila c0b <14798161+c0b@users.noreply.github.com> Damian Alec Perkins -Teppei Sato Jinwoo Lee Peter Marton Erwin W. Ramadhan @@ -2154,9 +2156,7 @@ Nick Filatov Jesse Gorzinski Pieter Mees Malcolm White -Gerhard Stoebich Matei Copot -ikasumiwt Gurin, Sebastian Indranil Dasgupta Harry Sarson @@ -2187,7 +2187,6 @@ Kyle Martin Denis Fäcke Daylor Yanes Carrie Coxwell -BeniCheni Masashi Hirano Brandon Ruggles Allen Yonghuang Wang @@ -2218,6 +2217,7 @@ Abhimanyu Vashisht Sagir Khan Kael Zhang Unknown +Krzysztof Taborski Blaine Bublitz Shailesh Shekhawat Davis Okoth @@ -2236,5 +2236,87 @@ Shelley Vohr Deepjyoti Mondal Brett Kiefer Kevin Thomas +ZaneHannanAU +Fernando Doglio +Renée Kooi +Jo Colina +itaysabato +Victor Belozyorov +Joonas Rouhiainen +GauthamBanasandra +Hugo Josefson +Weijia Wang +Sam Ruby +Haroon Khan +Developer Davo +Jacek Pospychała +MaleDong +iwko +Sohail Rajdev +Niicck +Denys Otrishko +Sergey Zelenov +Travis Fischer +Dominic Farolino +Octavian Soldea +XhmikosR +AdityaSrivast +Javier Gonzalez +RidgeA +Ryuichi Sakagami +hectorcoronado +Petras <15868923+kimberlake@users.noreply.github.com> +Kevin Lacabane <5239883+klacabane@users.noreply.github.com> +Simionescu, Radu +mariotsi +prayag21 <10997858+prayag21@users.noreply.github.com> +Bruno Pinho +Anto Aravinth +Helio Frota <00hf11@gmail.com> +Tim Ruffles +Jacob Page +sagulati +conectado +Vitor Bruno de Oliveira Barth +cclauss +James Ide +MaleDong +bhavayAnand9 +Brandon Lee <40652534+brandonlwt@users.noreply.github.com> +Oryan Moshe +Michael Sommer +Eugene Y. Q. Shen +Rishabh Singh +Marco Levrero +Ouyang Yadong +yahavfuchs +Thomas Leah +Musa Hamwala +James Bromwell +Jeremy Apthorp +Eugen Cazacu <32613393+oygen87@users.noreply.github.com> +James Bromwell <943160+thw0rted@users.noreply.github.com> +Csaba Palfi +Ryan Petrich +Andreas Girgensohn +Caleb Sander +Dzmitry_Prudnikau +Ian McKellar +Jennifer Bland +Kyle Fuller +ZYSzys +Neeraj Laad +Scott Van Gilder +Yaniv Friedensohn +Lars-Magnus Skog +Lucas Woo +Troels Liebe Bentsen +pranshuchittora +lakamsani +Chris White +Ben Newman +Szymon Marczak +Tessei Kameyama +Chakravarthy S M -# Generated by tools/update-authors.sh +# Generated by tools/update-authors.js From 800c938193607ac022c70b7bee6e9f91508c6d21 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Sun, 9 Sep 2018 13:35:04 +0200 Subject: [PATCH 3/4] fixup! tools: implement update-authors in JS --- tools/update-authors.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/update-authors.js b/tools/update-authors.js index 43b8235f940fc1..1c48eaec85c823 100755 --- a/tools/update-authors.js +++ b/tools/update-authors.js @@ -28,12 +28,13 @@ const seen = new Set(); // `Co-authored-by:` in the message body. Both have been used in the past // to indicate multiple authors per commit, with the latter standardized // by GitHub now. -const authorRe = /(?:^Author:|^Co-authored-by:)\s+([^<]+)\s+(<[^>]+>)/i; +const authorRe = + /(^Author:|^Co-authored-by:)\s+(?[^<]+)\s+(?<[^>]+>)/i; rl.on('line', (line) => { const match = line.match(authorRe); if (!match) return; - const [ _, author, email ] = match; // eslint-disable-line no-unused-vars + const { author, email } = match.groups; if (seen.has(email) || /@chromium\.org/.test(email) || email === '') { From c7d72496e8feeba90ff341d2ab3cb4e84e555a42 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Tue, 11 Sep 2018 14:30:04 +0200 Subject: [PATCH 4/4] fixup! doc: update AUTHORS list --- .mailmap | 3 ++- AUTHORS | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.mailmap b/.mailmap index 679ca986eec6c7..a92a050f4a6caf 100644 --- a/.mailmap +++ b/.mailmap @@ -394,7 +394,8 @@ Vladimir de Turckheim vsemozhetbyt Vse Mozhet Byt Wang Xinyong Weijia Wang <381152119@qq.com> -Weijia Wang <381152119@qq.com> starkewang +Weijia Wang <381152119@qq.com> +Weijia Wang <381152119@qq.com> Wei-Wei Wu Willi Eggeling Will Hayslett diff --git a/AUTHORS b/AUTHORS index da453e0f27e688..57d414e7818d22 100644 --- a/AUTHORS +++ b/AUTHORS @@ -2245,7 +2245,6 @@ Victor Belozyorov Joonas Rouhiainen GauthamBanasandra Hugo Josefson -Weijia Wang Sam Ruby Haroon Khan Developer Davo