What's wrong
GitLogParser (GitIntegration/Parsing/GitLogParser.cs, lines ~63 and ~69) parses the author email and the committer email with GitParseValues.ToSemantic<GitAuthorEmail>. That method rejects an empty string, and GitAuthorEmail also carries [HasNonWhitespaceContent].
Git itself accepts commits with an empty email:
git -c user.name=a -c user.email= commit --allow-empty -m x succeeds.
git log -1 --format='[%an][%ae]' then prints [a][].
Commits like this, with an empty <> email, are common in imported histories (svn/cvs conversions, git fast-import, commit-tree, bots).
Failure scenario
Call repo.Log().ExecuteAsync() on any repository whose history contains one such commit. The whole call fails:
GitParseException: git reported a author email that is not valid: ''.
The caller gets no commits at all, not even the valid ones. One bad commit anywhere in the range makes Log() unusable for that repository. An empty author or committer name, which fast-import / commit-tree can also produce, fails the same way.
Suggested fix / acceptance criteria
- Let
GitSignature.Email represent "no email". Either make it nullable (GitAuthorEmail?), or drop HasNonWhitespaceContent from GitAuthorEmail.
- Parse fields 3, 4, 6 and 7 with a helper that maps
"" to null (or to empty) instead of throwing.
- Add a test that builds a commit with
user.email= (and one with an empty name via commit-tree) and asserts that Log() returns it.
What's wrong
GitLogParser(GitIntegration/Parsing/GitLogParser.cs, lines ~63 and ~69) parses the author email and the committer email withGitParseValues.ToSemantic<GitAuthorEmail>. That method rejects an empty string, andGitAuthorEmailalso carries[HasNonWhitespaceContent].Git itself accepts commits with an empty email:
git -c user.name=a -c user.email= commit --allow-empty -m xsucceeds.git log -1 --format='[%an][%ae]'then prints[a][].Commits like this, with an empty
<>email, are common in imported histories (svn/cvs conversions,git fast-import,commit-tree, bots).Failure scenario
Call
repo.Log().ExecuteAsync()on any repository whose history contains one such commit. The whole call fails:The caller gets no commits at all, not even the valid ones. One bad commit anywhere in the range makes
Log()unusable for that repository. An empty author or committer name, whichfast-import/commit-treecan also produce, fails the same way.Suggested fix / acceptance criteria
GitSignature.Emailrepresent "no email". Either make it nullable (GitAuthorEmail?), or dropHasNonWhitespaceContentfromGitAuthorEmail.""to null (or to empty) instead of throwing.user.email=(and one with an empty name viacommit-tree) and asserts thatLog()returns it.