Skip to content

Commit f0440a2

Browse files
committed
Make it possible for validate-committer-lists to dump a mailmap file
https://bugs.webkit.org/show_bug.cgi?id=198517 Reviewed by Simon Fraser. .: * .gitignore: Ignore .mailmap files. Tools: Mailmaps wildly improve the output of various Git tools, including `git shortlog -sne`, mapping committers to our canonical name/email pair. * Scripts/validate-committer-lists: (CommitterListFromGit): (CommitterListBugzillaChecker.print_committers_with_invalid_bugzilla_emails): Add some missing legacy username mappings. (dump_mailmap): (dump_mailmap.format_email): (dump_mailmap.format_email_with_gitsvn_uuid): (dump_mailmap.map_emails_to_legacy_username): (main): Add `validate-committer-lists --dump-mailmap`, which generates one given committers.json and the existing mapping of legacy username to email addresses that exists in validate-committer-lists. Canonical link: https://commits.webkit.org/212816@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@246414 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 987f163 commit f0440a2

4 files changed

Lines changed: 102 additions & 2 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ build/
1111
autoinstall.cache.d
1212
project.xcworkspace
1313
xcuserdata
14+
.mailmap
1415

1516
# Ignore auto-generated files by VS & VSCode.
1617
*.vcproj.*.user

ChangeLog

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
2019-06-13 Tim Horton <timothy_horton@apple.com>
2+
3+
Make it possible for validate-committer-lists to dump a mailmap file
4+
https://bugs.webkit.org/show_bug.cgi?id=198517
5+
6+
Reviewed by Simon Fraser.
7+
8+
* .gitignore:
9+
Ignore .mailmap files.
10+
111
2019-06-11 Carlos Garcia Campos <cgarcia@igalia.com>
212

313
[GTK] Remove option REDIRECTED_XCOMPOSITE_WINDOW

Tools/ChangeLog

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
2019-06-13 Tim Horton <timothy_horton@apple.com>
2+
3+
Make it possible for validate-committer-lists to dump a mailmap file
4+
https://bugs.webkit.org/show_bug.cgi?id=198517
5+
6+
Reviewed by Simon Fraser.
7+
8+
Mailmaps wildly improve the output of various Git tools, including
9+
`git shortlog -sne`, mapping committers to our canonical name/email pair.
10+
11+
* Scripts/validate-committer-lists:
12+
(CommitterListFromGit):
13+
(CommitterListBugzillaChecker.print_committers_with_invalid_bugzilla_emails):
14+
Add some missing legacy username mappings.
15+
16+
(dump_mailmap):
17+
(dump_mailmap.format_email):
18+
(dump_mailmap.format_email_with_gitsvn_uuid):
19+
(dump_mailmap.map_emails_to_legacy_username):
20+
(main):
21+
Add `validate-committer-lists --dump-mailmap`, which generates
22+
one given committers.json and the existing mapping of legacy username
23+
to email addresses that exists in validate-committer-lists.
24+
125
2019-06-12 Aakash Jain <aakash_jain@apple.com>
226

327
Replace double-quotes with single quotes in loadConfig.py

Tools/Scripts/validate-committer-lists

Lines changed: 67 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,20 +121,39 @@ class CommitterListFromMailingList(object):
121121

122122
class CommitterListFromGit(object):
123123
login_to_email_address = {
124+
'aboule' : 'aboule@apple.com',
125+
'adachan' : 'adachan@apple.com',
126+
'adele' : 'adele@apple.com',
124127
'aliceli1' : 'alice.liu@apple.com',
128+
'alp' : 'alp@nuanti.com',
129+
'andersca' : 'andersca@apple.com',
130+
'antti' : 'koivisto@iki.fi',
131+
'ap' : 'ap@webkit.org',
132+
'aroben' : 'aroben@webkit.org',
133+
'bdakin' : 'bdakin@apple.com',
125134
'bdash' : 'mrowe@apple.com',
126135
'bdibello' : 'bdibello@apple.com', # Bruce DiBello, only 4 commits: r10023, r9548, r9538, r9535
136+
'beidson' : 'beidson@apple.com',
127137
'cblu' : 'cblu@apple.com',
128138
'cpeterse' : 'cpetersen@apple.com',
139+
'darin' : 'darin@apple.com',
140+
'ddkilzer' : 'ddkilzer@webkit.org',
141+
'dsmith' : 'catfish.man@gmail.com',
129142
'eseidel' : 'eric@webkit.org',
130143
'gdennis' : 'gdennis@webkit.org',
144+
'ggaren' : 'ggaren@apple.com',
131145
'goldsmit' : 'goldsmit@apple.com', # Debbie Goldsmith, only one commit r8839
132146
'gramps' : 'gramps@apple.com',
147+
'harrison' : 'harrison@apple.com',
148+
'hausmann' : 'hausmann@webkit.org',
133149
'honeycutt' : 'jhoneycutt@apple.com',
150+
'hyatt' : 'hyatt@apple.com',
134151
'jdevalk' : 'joost@webkit.org',
135152
'jens' : 'jens@apple.com',
136153
'justing' : 'justin.garcia@apple.com',
137154
'kali' : 'kali@apple.com', # Christy Warren, did BIDI work, 5 commits: r8815, r8802, r8801, r8791, r8773, r8603
155+
'kdecker' : 'kdecker@apple.com',
156+
'kevino' : 'kevino@theolliviers.com',
138157
'kjk' : 'kkowalczyk@gmail.com',
139158
'kmccullo' : 'kmccullough@apple.com',
140159
'kocienda' : 'kocienda@apple.com',
@@ -143,18 +162,30 @@ class CommitterListFromGit(object):
143162
'lweintraub' : 'lweintraub@apple.com',
144163
'lypanov' : 'lypanov@kde.org',
145164
'mhay' : 'mhay@apple.com', # Mike Hay, 3 commits: r3813, r2552, r2548
165+
'mitz' : 'mitz@webkit.org',
166+
'mjs' : 'mjs@apple.com',
167+
'oliver' : 'oliver@apple.com',
146168
'ouch' : 'ouch@apple.com', # John Louch
169+
'pewtermoose' : 'dev+webkit@mattlilek.com',
147170
'pyeh' : 'patti@apple.com', # Patti Yeh, did VoiceOver work in WebKit
148171
'rjw' : 'rjw@apple.com',
172+
'rwlbuis' : 'rwlbuis@gmail.com',
149173
'seangies' : 'seangies@apple.com', # Sean Gies?, only 5 commits: r16600, r16592, r16511, r16489, r16484
174+
'sfalken' : 'sfalken@apple.com',
150175
'sheridan' : 'sheridan@apple.com', # Shelly Sheridan
176+
'slewis' : 'slewis@apple.com',
177+
'staikos' : 'staikos@kde.org',
178+
'sullivan' : 'sullivan@apple.com',
151179
'thatcher' : 'timothy@apple.com',
152180
'tomernic' : 'timo@apple.com',
181+
'treat' : 'manyoso@yahoo.com',
153182
'trey' : 'trey@usa.net',
154183
'tristan' : 'tristan@apple.com',
155184
'vicki' : 'vicki@apple.com',
156185
'voas' : 'voas@apple.com', # Ed Voas, did some Carbon work in WebKit
186+
'weinig' : 'sam@webkit.org',
157187
'zack' : 'zack@kde.org',
188+
'zecke' : 'zecke@selfish.org',
158189
'zimmermann' : 'zimmermann@webkit.org',
159190
}
160191

@@ -303,24 +334,58 @@ class CommitterListBugzillaChecker(object):
303334
print_list_if_non_empty("Committers with invalid bugzilla email:", committers_with_invalid_bugzilla_email)
304335

305336

337+
def dump_mailmap(committer_list):
338+
def format_email(email):
339+
return "<{0}>".format(email)
340+
341+
def format_email_with_gitsvn_uuid(email):
342+
return "<{0}@268f45cc-cd09-0410-ab3c-d52691b4dbfc>".format(email)
343+
344+
email_to_legacy_username = dict(map(reversed, CommitterListFromGit.login_to_email_address.items()))
345+
def map_emails_to_legacy_username(emails):
346+
legacy_username = None
347+
for email in emails:
348+
legacy_username = email_to_legacy_username.get(email)
349+
if legacy_username:
350+
break
351+
return legacy_username
352+
353+
for contributor in committer_list.contributors():
354+
full_name = contributor.full_name.encode("utf-8")
355+
canonical_email = contributor.bugzilla_email()
356+
other_emails = contributor.emails
357+
legacy_username = map_emails_to_legacy_username(contributor.emails)
358+
if legacy_username:
359+
other_emails.append(legacy_username)
360+
361+
for other_email in other_emails:
362+
print full_name, format_email(canonical_email), format_email(other_email)
363+
print full_name, format_email(canonical_email), format_email_with_uuid(other_email)
364+
365+
306366
def main():
307367
parser = OptionParser()
308368
parser.add_option("-b", "--check-bugzilla-emails", action="store_true", help="Check the bugzilla_email for each committer against bugs.webkit.org")
309369
parser.add_option("-d", "--dump", action="store_true", help="Dump the contributor list as JSON to stdout (suitable for saving to contributors.json)")
370+
parser.add_option("--dump-mailmap", action="store_true", help="Dump the contributor list as a Git Mailmap to stdout")
310371
parser.add_option("-c", "--canonicalize", action="store_true", help="Canonicalize contributors.json, rewriting it in-place")
311372

312373
(options, args) = parser.parse_args()
313374

314375
committer_list = CommitterList()
315376
if options.dump:
316377
print committer_list.as_json()
317-
return 0;
378+
return 0
379+
380+
if options.dump_mailmap:
381+
dump_mailmap(committer_list)
382+
return 0
318383

319384
if options.canonicalize:
320385
print "Updating contributors.json in-place..."
321386
committer_list.reformat_in_place()
322387
print "Done"
323-
return 0;
388+
return 0
324389

325390
CommitterListFromMailingList().check_for_emails_missing_from_list(committer_list)
326391

0 commit comments

Comments
 (0)