Title: [246414] trunk
Revision
246414
Author
[email protected]
Date
2019-06-13 14:22:21 -0700 (Thu, 13 Jun 2019)

Log Message

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.

Modified Paths

Diff

Modified: trunk/.gitignore (246413 => 246414)


--- trunk/.gitignore	2019-06-13 21:20:26 UTC (rev 246413)
+++ trunk/.gitignore	2019-06-13 21:22:21 UTC (rev 246414)
@@ -11,6 +11,7 @@
 autoinstall.cache.d
 project.xcworkspace
 xcuserdata
+.mailmap
 
 # Ignore auto-generated files by VS & VSCode.
 *.vcproj.*.user

Modified: trunk/ChangeLog (246413 => 246414)


--- trunk/ChangeLog	2019-06-13 21:20:26 UTC (rev 246413)
+++ trunk/ChangeLog	2019-06-13 21:22:21 UTC (rev 246414)
@@ -1,3 +1,13 @@
+2019-06-13  Tim Horton  <[email protected]>
+
+        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.
+
 2019-06-11  Carlos Garcia Campos  <[email protected]>
 
         [GTK] Remove option REDIRECTED_XCOMPOSITE_WINDOW

Modified: trunk/Tools/ChangeLog (246413 => 246414)


--- trunk/Tools/ChangeLog	2019-06-13 21:20:26 UTC (rev 246413)
+++ trunk/Tools/ChangeLog	2019-06-13 21:22:21 UTC (rev 246414)
@@ -1,3 +1,27 @@
+2019-06-13  Tim Horton  <[email protected]>
+
+        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.
+
+        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.
+
 2019-06-12  Aakash Jain  <[email protected]>
 
         Replace double-quotes with single quotes in loadConfig.py

Modified: trunk/Tools/Scripts/validate-committer-lists (246413 => 246414)


--- trunk/Tools/Scripts/validate-committer-lists	2019-06-13 21:20:26 UTC (rev 246413)
+++ trunk/Tools/Scripts/validate-committer-lists	2019-06-13 21:22:21 UTC (rev 246414)
@@ -121,20 +121,39 @@
 
 class CommitterListFromGit(object):
     login_to_email_address = {
+        'aboule' : '[email protected]',
+        'adachan' : '[email protected]',
+        'adele' : '[email protected]',
         'aliceli1' : '[email protected]',
+        'alp' : '[email protected]',
+        'andersca' : '[email protected]',
+        'antti' : '[email protected]',
+        'ap' : '[email protected]',
+        'aroben' : '[email protected]',
+        'bdakin' : '[email protected]',
         'bdash' : '[email protected]',
         'bdibello' : '[email protected]', # Bruce DiBello, only 4 commits: r10023, r9548, r9538, r9535
+        'beidson' : '[email protected]',
         'cblu' : '[email protected]',
         'cpeterse' : '[email protected]',
+        'darin' : '[email protected]',
+        'ddkilzer' : '[email protected]',
+        'dsmith' : '[email protected]',
         'eseidel' : '[email protected]',
         'gdennis' : '[email protected]',
+        'ggaren' : '[email protected]',
         'goldsmit' : '[email protected]', # Debbie Goldsmith, only one commit r8839
         'gramps' : '[email protected]',
+        'harrison' : '[email protected]',
+        'hausmann' : '[email protected]',
         'honeycutt' : '[email protected]',
+        'hyatt' : '[email protected]',
         'jdevalk' : '[email protected]',
         'jens' : '[email protected]',
         'justing' : '[email protected]',
         'kali' : '[email protected]', # Christy Warren, did BIDI work, 5 commits: r8815, r8802, r8801, r8791, r8773, r8603
+        'kdecker' : '[email protected]',
+        'kevino' : '[email protected]',
         'kjk' : '[email protected]',
         'kmccullo' : '[email protected]',
         'kocienda' : '[email protected]',
@@ -143,18 +162,30 @@
         'lweintraub' : '[email protected]',
         'lypanov' : '[email protected]',
         'mhay' : '[email protected]', # Mike Hay, 3 commits: r3813, r2552, r2548
+        'mitz' : '[email protected]',
+        'mjs' : '[email protected]',
+        'oliver' : '[email protected]',
         'ouch' : '[email protected]', # John Louch
+        'pewtermoose' : '[email protected]',
         'pyeh' : '[email protected]', # Patti Yeh, did VoiceOver work in WebKit
         'rjw' : '[email protected]',
+        'rwlbuis' : '[email protected]',
         'seangies' : '[email protected]', # Sean Gies?, only 5 commits: r16600, r16592, r16511, r16489, r16484
+        'sfalken' : '[email protected]',
         'sheridan' : '[email protected]', # Shelly Sheridan
+        'slewis' : '[email protected]',
+        'staikos' : '[email protected]',
+        'sullivan' : '[email protected]',
         'thatcher' : '[email protected]',
         'tomernic' : '[email protected]',
+        'treat' : '[email protected]',
         'trey' : '[email protected]',
         'tristan' : '[email protected]',
         'vicki' : '[email protected]',
         'voas' : '[email protected]', # Ed Voas, did some Carbon work in WebKit
+        'weinig' : '[email protected]',
         'zack' : '[email protected]',
+        'zecke' : '[email protected]',
         'zimmermann' : '[email protected]',
     }
 
@@ -303,10 +334,40 @@
         print_list_if_non_empty("Committers with invalid bugzilla email:", committers_with_invalid_bugzilla_email)
 
 
+def dump_mailmap(committer_list):
+    def format_email(email):
+        return "<{0}>".format(email)
+
+    def format_email_with_gitsvn_uuid(email):
+        return "<{0}@268f45cc-cd09-0410-ab3c-d52691b4dbfc>".format(email)        
+
+    email_to_legacy_username = dict(map(reversed, CommitterListFromGit.login_to_email_address.items()))
+    def map_emails_to_legacy_username(emails):
+        legacy_username = None
+        for email in emails:
+            legacy_username = email_to_legacy_username.get(email)
+            if legacy_username:
+                break
+        return legacy_username
+
+    for contributor in committer_list.contributors():
+        full_name = contributor.full_name.encode("utf-8")
+        canonical_email = contributor.bugzilla_email()
+        other_emails = contributor.emails
+        legacy_username = map_emails_to_legacy_username(contributor.emails)
+        if legacy_username:
+            other_emails.append(legacy_username)
+
+        for other_email in other_emails:
+            print full_name, format_email(canonical_email), format_email(other_email)
+            print full_name, format_email(canonical_email), format_email_with_uuid(other_email)
+
+
 def main():
     parser = OptionParser()
     parser.add_option("-b", "--check-bugzilla-emails", action="" help="Check the bugzilla_email for each committer against bugs.webkit.org")
     parser.add_option("-d", "--dump", action="" help="Dump the contributor list as JSON to stdout (suitable for saving to contributors.json)")
+    parser.add_option("--dump-mailmap", action="" help="Dump the contributor list as a Git Mailmap to stdout")
     parser.add_option("-c", "--canonicalize", action="" help="Canonicalize contributors.json, rewriting it in-place")
 
     (options, args) = parser.parse_args()
@@ -314,13 +375,17 @@
     committer_list = CommitterList()
     if options.dump:
         print committer_list.as_json()
-        return 0;
+        return 0
 
+    if options.dump_mailmap:
+        dump_mailmap(committer_list)
+        return 0
+
     if options.canonicalize:
         print "Updating contributors.json in-place..."
         committer_list.reformat_in_place()
         print "Done"
-        return 0;
+        return 0
 
     CommitterListFromMailingList().check_for_emails_missing_from_list(committer_list)
  
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to