Skip to content

[minor] Read a commit with an empty signature name or email - #133

Merged
matt-edmondson merged 1 commit into
mainfrom
claude/gitintegration-130-empty-signature
Sep 28, 2026
Merged

matt-edmondson merged 1 commit into
mainfrom
claude/gitintegration-130-empty-signature

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Fixes #130

Problem

GitLogParser parsed each signature name and email with GitParseValues.ToSemantic, which rejects an empty value. Git does record empty values: a commit made with an empty user.email records <>, and commit-tree or fast-import can write an empty name. One such commit anywhere in the requested range made Log().ExecuteAsync() throw GitParseException for the whole history.

Change

  • GitParseValues.ToOptionalSemantic<T> returns null for a blank field and otherwise validates exactly as ToSemantic does.
  • GitLogParser now uses it for the author and committer name and email fields.
  • GitSignature.Name and GitSignature.Email are now GitAuthorName? and GitAuthorEmail?. Both are still required, 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

  • Added ReadsAnEmptySignatureEmailAsNull and ReadsAnEmptySignatureNameAsNull to GitLogParserTests.
  • With the source change reverted, both new tests fail.
  • With the fix, the full suite passes: 714 of 714.

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

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
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Log() throws GitParseException for the whole history if any commit has an empty author/committer email (e.g. <>)

2 participants