Skip to content

pkg/vcs/git: improve handling of commonly malformed email addresses

Administrator requested to merge sg/shortlog into master

Created by: slimsag

Depends on https://github.com/sourcegraph/sourcegraph/pull/5625

Please see the doc-string on lenientParseAddress for an explanation of what this change is. In specific, it is to support commonly malformed email addresses in the form of [email protected] <[email protected]> where a user has misconfigured their email provider to set their name as their email address. Go's net/mail.ParserAddress does not handle this case and fails today, leaving the user with no email address. Gathering what is there seems more sensible, even if it isn't exactly allowed in the email address RFC.

Note this is common enough that a customer reported it, and there are random blogs online that discuss this being somewhat common.

Test plan: I solely used TDD for this.

Merge request reports

Loading