@@ -25,7 +25,8 @@ class CaseIndifferentMap {
2525const log = spawn (
2626 'git' ,
2727 // Inspect author name/email and body.
28- [ 'log' , '--reverse' , '--format=Author: %aN <%aE>\n%b' ] , {
28+ [ 'log' , '--reverse' ] ,
29+ {
2930 stdio : [ 'inherit' , 'pipe' , 'inherit' ]
3031 } )
3132const rl = readline . createInterface ( { input : log . stdout } )
@@ -77,17 +78,40 @@ const mailmap = new CaseIndifferentMap()
7778
7879const seen = new Set ( )
7980
81+ // Commits from which we do not want the author to pop up in the AUTHORS list,
82+ // for example because the commit was done with a wrong git user account
83+ const ignoreCommits = [
84+ '43d4551e7c19f51d30e71b35009437c7ec6491f0'
85+ ]
86+ let currentCommit
87+
8088// Support regular git author metadata, as well as `Author:` and
8189// `Co-authored-by:` in the message body. Both have been used in the past
8290// to indicate multiple authors per commit, with the latter standardized
8391// by GitHub now.
8492const authorRe =
85- / ( ^ A u t h o r : | ^ C o - a u t h o r e d - b y : ) \s + (?< author > [ ^ < ] + ) \s + (?< email > < [ ^ > ] + > ) / i
93+ / ( ^ A u t h o r : | ^ \s * C o - a u t h o r e d - b y : ) \s + (?< author > [ ^ < ] + ) \s + (?< email > < [ ^ > ] + > ) / i
94+
95+ // Commit line regex. Example: "commit 123456"
96+ const commitRe = / ^ c o m m i t (?< commit > .+ ) $ / i
97+
8698rl . on ( 'line' , ( line ) => {
87- const match = line . match ( authorRe )
88- if ( ! match ) return
99+ const commitMatch = line . match ( commitRe )
100+ if ( commitMatch ) {
101+ currentCommit = commitMatch . groups . commit
102+ return
103+ }
104+
105+ if ( ignoreCommits . includes ( currentCommit ) ) {
106+ return
107+ }
108+
109+ const authorMatch = line . match ( authorRe )
110+ if ( ! authorMatch ) {
111+ return
112+ }
89113
90- const { author, email } = match . groups
114+ const { author, email } = authorMatch . groups
91115
92116 if ( seen . has ( email ) ||
93117 / @ c h r o m i u m \. o r g / . test ( email ) ||
0 commit comments