Repository navigation
Conversation
Notes commits written through git fast-import used hard-coded placeholder
committers (git-ai <git-ai@local>, and git-ai <git-ai@noreply> for the
fallback notes merge). Server-side push rules that enforce a committer-email
pattern reject pushes of refs/notes/ai because of them.
Add an opt-in `notes_committer` setting ({name, email}) in
~/.git-ai/config.json, also settable via
`git-ai config set notes_committer '{"name":"...","email":"..."}'`.
When set, its fields are used as the committer of refs/notes/ai commits;
any unset field keeps the existing placeholder, so behavior is unchanged
for anyone who doesn't configure it. The setting is read with
Config::fresh() so the long-lived daemon picks up changes without a
restart.
Closes git-ai-project#2491
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01J3jso3jNLQtW8TCvytWn73
A configured name or email containing `<`, `>` or a line break broke the fast-import committer line, so the notes write failed and the commit was left without its authorship note. Such fields now fall back to the git-ai placeholder. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01J3jso3jNLQtW8TCvytWn73
Mirror the `author` override: `git-ai config set|unset|<get>` now accept the dotted `notes_committer.name` and `notes_committer.email` keys by extending the existing author nested-key branches to both sections. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01J3jso3jNLQtW8TCvytWn73
This branch has not been deployed
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.
Closes #2491
Problem
Commits on
refs/notes/aiwritten throughgit fast-importuse a hard-coded committer (git-ai <git-ai@local>, andgit-ai <git-ai@noreply>for the fallback notes merge). Server-side push rules that enforce a committer-email pattern (e.g. GitLab's "Commit committer's email" rule) reject pushes ofrefs/notes/aibecause of it.Change
An opt-in
notes_committersetting in~/.git-ai/config.json:{ "notes_committer": { "name": "Jane Doe", "email": "[email protected]" } }managed with the same CLI model as
author:(the whole object can also be set with
git-ai config set notes_committer '{"name":"…","email":"…"}', likeauthor). The dotted-key handling extends the existingauthorbranches rather than duplicating them;authorerror messages are unchanged.refs/notes/aicommits written bynotes_add_batch,notes_add_blob_batch, andfallback_merge_notes_ours.<,>, line breaks) is ignored and falls back to the placeholder, so a bad value can't corrupt the stream and drop the authorship note.AuthorConfigtype (name/email, normalized the same way asauthor).Config::fresh(), the same pattern the daemon already uses fornotes_backendin its fetch side-effect path, so the long-lived daemon picks up changes without a restart. This adds no git spawns and nothing on the trace2 ingestion path; it's one config read per notes write.refs/notes/ai-displaycache ref (never pushed) is intentionally left untouched.Tests (TDD)
Each test was written first and observed failing before the implementation:
tests/integration/notes_committer.rs(TestRepo, dedicated daemon):git-ai <git-ai@local>name+emailare usednamekeepsgit-aiwith the configured email</>/line breaks fall back to the placeholder and the note is still writtennotes_merge_mixed_fanout::test_fetch_notes_with_locally_corrupted_mixed_fanout_treenow also asserts that the fallback merge commit uses the configured committer.config_cli_coverage:notes_committeradded to the fully-populatedFileConfigguard, plus set/get/unset round-trip tests for both the object form and the dottednotes_committer.name/.emailkeys.Locally, the full suite passes except
blame_flags::test_blame_configured_markers_match_native_git, which fails identically on unmodifiedmainin my environment (git 2.43.0), so it's unrelated to this change.🤖 Generated with Claude Code
https://claude.ai/code/session_01J3jso3jNLQtW8TCvytWn73