Title: [246414] trunk
Revision
246414
Author
timothy_hor...@apple.com
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  <timothy_hor...@apple.com>
+
+        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  <cgar...@igalia.com>
 
         [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  <timothy_hor...@apple.com>
+
+        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  <aakash_j...@apple.com>
 
         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' : 'abo...@apple.com',
+        'adachan' : 'adac...@apple.com',
+        'adele' : 'ad...@apple.com',
         'aliceli1' : 'alice....@apple.com',
+        'alp' : 'a...@nuanti.com',
+        'andersca' : 'ander...@apple.com',
+        'antti' : 'koivi...@iki.fi',
+        'ap' : 'a...@webkit.org',
+        'aroben' : 'aro...@webkit.org',
+        'bdakin' : 'bda...@apple.com',
         'bdash' : 'mr...@apple.com',
         'bdibello' : 'bdibe...@apple.com', # Bruce DiBello, only 4 commits: r10023, r9548, r9538, r9535
+        'beidson' : 'beid...@apple.com',
         'cblu' : 'c...@apple.com',
         'cpeterse' : 'cpeter...@apple.com',
+        'darin' : 'da...@apple.com',
+        'ddkilzer' : 'ddkil...@webkit.org',
+        'dsmith' : 'catfish....@gmail.com',
         'eseidel' : 'e...@webkit.org',
         'gdennis' : 'gden...@webkit.org',
+        'ggaren' : 'gga...@apple.com',
         'goldsmit' : 'golds...@apple.com', # Debbie Goldsmith, only one commit r8839
         'gramps' : 'gra...@apple.com',
+        'harrison' : 'harri...@apple.com',
+        'hausmann' : 'hausm...@webkit.org',
         'honeycutt' : 'jhoneyc...@apple.com',
+        'hyatt' : 'hy...@apple.com',
         'jdevalk' : 'jo...@webkit.org',
         'jens' : 'j...@apple.com',
         'justing' : 'justin.gar...@apple.com',
         'kali' : 'k...@apple.com', # Christy Warren, did BIDI work, 5 commits: r8815, r8802, r8801, r8791, r8773, r8603
+        'kdecker' : 'kdec...@apple.com',
+        'kevino' : 'kev...@theolliviers.com',
         'kjk' : 'kkowalc...@gmail.com',
         'kmccullo' : 'kmccullo...@apple.com',
         'kocienda' : 'kocie...@apple.com',
@@ -143,18 +162,30 @@
         'lweintraub' : 'lweintr...@apple.com',
         'lypanov' : 'lypa...@kde.org',
         'mhay' : 'm...@apple.com', # Mike Hay, 3 commits: r3813, r2552, r2548
+        'mitz' : 'm...@webkit.org',
+        'mjs' : 'm...@apple.com',
+        'oliver' : 'oli...@apple.com',
         'ouch' : 'o...@apple.com', # John Louch
+        'pewtermoose' : 'dev+web...@mattlilek.com',
         'pyeh' : 'pa...@apple.com', # Patti Yeh, did VoiceOver work in WebKit
         'rjw' : 'r...@apple.com',
+        'rwlbuis' : 'rwlb...@gmail.com',
         'seangies' : 'seang...@apple.com', # Sean Gies?, only 5 commits: r16600, r16592, r16511, r16489, r16484
+        'sfalken' : 'sfal...@apple.com',
         'sheridan' : 'sheri...@apple.com', # Shelly Sheridan
+        'slewis' : 'sle...@apple.com',
+        'staikos' : 'stai...@kde.org',
+        'sullivan' : 'sulli...@apple.com',
         'thatcher' : 'timo...@apple.com',
         'tomernic' : 't...@apple.com',
+        'treat' : 'many...@yahoo.com',
         'trey' : 't...@usa.net',
         'tristan' : 'tris...@apple.com',
         'vicki' : 'vi...@apple.com',
         'voas' : 'v...@apple.com', # Ed Voas, did some Carbon work in WebKit
+        'weinig' : 's...@webkit.org',
         'zack' : 'z...@kde.org',
+        'zecke' : 'ze...@selfish.org',
         'zimmermann' : 'zimmerm...@webkit.org',
     }
 
@@ -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
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to