chrome_committer: Remove committer email argument.

This command line argument required the CL uploader to be able to
forge user credentials, which not all of our accounts have, and which
we generally do not want to require. So... stop trying to forge
credentials.

In practice, this means that we will start generating CLs from the
account 3su6n15k.default@developer.gserviceaccount.com, but should
have no other effect.

BUG=chromium:860584
TEST=run_tests
     Local run, which generated: https://crrev.com/c/1132235

Change-Id: I36c2d38d64f9eec8e91c139fa7c84c61324c00c7
Reviewed-on: https://chromium-review.googlesource.com/1132240
Tested-by: Don Garrett <dgarrett@chromium.org>
Trybot-Ready: Don Garrett <dgarrett@chromium.org>
Reviewed-by: Steven Bennetts <stevenjb@chromium.org>
diff --git a/lib/chrome_committer.py b/lib/chrome_committer.py
index 76f10c3..d41aca9 100644
--- a/lib/chrome_committer.py
+++ b/lib/chrome_committer.py
@@ -28,11 +28,8 @@
   def __init__(self, args):
     self._checkout_dir = args.workdir
     self._dryrun = args.dryrun
-    self._git_committer_args = ['-c', 'user.email=%s' % args.user_email,
-                                '-c', 'user.name=%s' % args.user_email]
     self._commit_msg = ''
 
-    logging.info('user_email=%s', args.user_email)
     logging.info('checkout_dir=%s', args.workdir)
 
   def __del__(self):
@@ -84,7 +81,7 @@
       for file_path in file_paths:
         git.AddPath(file_path)
       commit_args = ['commit', '-m', self._commit_msg]
-      git.RunGit(self._checkout_dir, self._git_committer_args + commit_args,
+      git.RunGit(self._checkout_dir, commit_args,
                  print_cmd=True, redirect_stderr=True, capture_output=False)
     except cros_build_lib.RunCommandError as e:
       raise CommitError('Could not create git commit: %r' % e)
@@ -108,7 +105,7 @@
           upload_args += ['--tbr-owners']
         # Marks CL as ready.
         upload_args += ['--send-mail']
-      git.RunGit(self._checkout_dir, self._git_committer_args + upload_args,
+      git.RunGit(self._checkout_dir, upload_args,
                  print_cmd=True, redirect_stderr=True, capture_output=False)
 
       # Flip the CQ commit bit.
@@ -139,9 +136,6 @@
     parser = commandline.ArgumentParser(usage=__doc__, add_help=False)
     parser.add_argument('--dryrun', action='store_true', default=False,
                         help='Don\'t commit changes or send out emails.')
-    parser.add_argument('--user_email', required=False,
-                        default='chromeos-commit-bot@chromium.org',
-                        help='Email address to use when comitting changes.')
     parser.add_argument('--workdir',
                         default=os.path.join(os.getcwd(), 'chrome_src'),
                         help=('Path to a checkout of the chrome src. '
diff --git a/lib/chrome_committer_unittest.py b/lib/chrome_committer_unittest.py
index 666873b..1c9851e 100644
--- a/lib/chrome_committer_unittest.py
+++ b/lib/chrome_committer_unittest.py
@@ -24,7 +24,6 @@
     def __init__(self, workdir):
       self.workdir = workdir
       self.dryrun = False
-      self.user_email = 'user@test.org'
 
 
   def setUp(self):
@@ -64,8 +63,6 @@
     self._assertCommand('git add -- OWNERS')
     self._assertCommand('git add -- BUILD.gn')
     self.assertCommandContains(['git',
-                                '-c', 'user.email=user@test.org',
-                                '-c', 'user.name=user@test.org',
                                 'commit', '-m',
                                 'Automated Commit: Modify OWNERS and BUILD.gn'])
 
@@ -86,8 +83,6 @@
     self.committer.Upload()
 
     self.assertCommandContains(['git',
-                                '-c', 'user.email=user@test.org',
-                                '-c', 'user.name=user@test.org',
                                 'cl', 'upload', '-v', '-m',
                                 'Automated Commit: Modify OWNERS and BUILD.gn',
                                 '--bypass-hooks', '-f',
@@ -107,8 +102,6 @@
     self.committer.Upload()
 
     self.assertCommandContains(['git',
-                                '-c', 'user.email=user@test.org',
-                                '-c', 'user.name=user@test.org',
                                 'cl', 'upload', '-v', '-m',
                                 'Automated Commit: Modify OWNERS and BUILD.gn',
                                 '--bypass-hooks', '-f'])