diff --git a/git_config.py b/git_config.py index dc209ba8..1382d5db 100644 --- a/git_config.py +++ b/git_config.py @@ -531,8 +531,11 @@ class Remote(object): def SshReviewUrl(self, userEmail): if self.ReviewProtocol != 'ssh': return None + username = self._config.GetString('review.%s.username' % self.review) + if username is None: + username = userEmail.split("@")[0] return 'ssh://%s@%s:%s/%s' % ( - userEmail.split("@")[0], + username, self._review_host, self._review_port, self.projectname) diff --git a/subcmds/upload.py b/subcmds/upload.py index 569e31c1..b47b37b8 100644 --- a/subcmds/upload.py +++ b/subcmds/upload.py @@ -92,6 +92,11 @@ review.URL.autocopy can be set to a comma separated list of reviewers who you always want copied on all uploads with a non-empty --re argument. +review.URL.username: + +Override the username used to connect to Gerrit Code Review. +By default the local part of the email address is used. + The URL must match the review URL listed in the manifest XML file, or in the .git/config within the project. For example: