[minor] Read a commit with an empty signature name or email - #133
Merged
Merged
Conversation
Log() parsed every signature field with ToSemantic, which rejects an empty value, so one commit recorded with "<>" (an empty user.email, or history written by fast-import or commit-tree) made the whole log throw GitParseException. Blank signature names and emails now parse as null, and GitSignature.Name and Email are nullable to say so. Fixes #130 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P1dENrzXtWG4vP7thSjyof
|
This was referenced Sep 27, 2026
matt-edmondson
deleted the
claude/gitintegration-130-empty-signature
branch
September 28, 2026 01:35
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Fixes #130
Problem
GitLogParserparsed each signature name and email withGitParseValues.ToSemantic, which rejects an empty value. Git does record empty values: a commit made with an emptyuser.emailrecords<>, andcommit-treeorfast-importcan write an empty name. One such commit anywhere in the requested range madeLog().ExecuteAsync()throwGitParseExceptionfor the whole history.Change
GitParseValues.ToOptionalSemantic<T>returnsnullfor a blank field and otherwise validates exactly asToSemanticdoes.GitLogParsernow uses it for the author and committer name and email fields.GitSignature.NameandGitSignature.Emailare nowGitAuthorName?andGitAuthorEmail?. Both are stillrequired, and the doc comments explain when each is null.API note: those two public properties are now nullable. That is binary compatible, but consumers with nullable analysis turned on will get new warnings where they dereference them. That is why the commit is tagged
[minor]. Change the tag if you would rather release this under a different bump.Tests
ReadsAnEmptySignatureEmailAsNullandReadsAnEmptySignatureNameAsNulltoGitLogParserTests.The build's SDK rewrite of
.gitattributes(#132) was discarded and is not part of this diff.🤖 Generated with Claude Code
https://claude.ai/code/session_01P1dENrzXtWG4vP7thSjyof
Generated by Claude Code