Skip to content

feat: make the committer identity of refs/notes/ai commits configurable - #2492

Open
camcima wants to merge 3 commits into
git-ai-project:mainfrom
camcima:feat/configurable-notes-committer
Open

camcima wants to merge 3 commits into
git-ai-project:mainfrom
camcima:feat/configurable-notes-committer

Conversation

@camcima

@camcima camcima commented Nov 23, 2026 •

Copy link
Copy Markdown

Closes #2491

Problem

Commits on refs/notes/ai written through git fast-import use a hard-coded committer (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 (e.g. GitLab's "Commit committer's email" rule) reject pushes of refs/notes/ai because of it.

Change

An opt-in notes_committer setting in ~/.git-ai/config.json:

{ "notes_committer": { "name": "Jane Doe", "email": "[email protected]" } }

managed with the same CLI model as author:

git-ai config set notes_committer.name "Jane Doe"
git-ai config set notes_committer.email [email protected]
git-ai config unset notes_committer.name
git-ai config notes_committer.email

(the whole object can also be set with git-ai config set notes_committer '{"name":"…","email":"…"}', like author). The dotted-key handling extends the existing author branches rather than duplicating them; author error messages are unchanged.

  • If it's set, those values are the committer of refs/notes/ai commits written by notes_add_batch, notes_add_blob_batch, and fallback_merge_notes_ours.
  • Any field left unset keeps the current placeholder. Nothing changes for anyone who doesn't configure it.
  • A field containing fast-import ident delimiters (<, >, line breaks) is ignored and falls back to the placeholder, so a bad value can't corrupt the stream and drop the authorship note.
  • It reuses the existing AuthorConfig type (name/email, normalized the same way as author).
  • It is read with Config::fresh(), the same pattern the daemon already uses for notes_backend in 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.
  • The local-only refs/notes/ai-display cache 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):
    • default stays git-ai <git-ai@local>
    • configured name + email are used
    • unset name keeps git-ai with the configured email
    • fields with </>/line breaks fall back to the placeholder and the note is still written
  • notes_merge_mixed_fanout::test_fetch_notes_with_locally_corrupted_mixed_fanout_tree now also asserts that the fallback merge commit uses the configured committer.
  • config_cli_coverage: notes_committer added to the fully-populated FileConfig guard, plus set/get/unset round-trip tests for both the object form and the dotted notes_committer.name/.email keys.

Locally, the full suite passes except blame_flags::test_blame_configured_markers_match_native_git, which fails identically on unmodified main in my environment (git 2.43.0), so it's unrelated to this change.

🤖 Generated with Claude Code

https://claude.ai/code/session_01J3jso3jNLQtW8TCvytWn73


Devin Review

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
Copilot AI balanced review requested due to automatic review settings November 23, 2026 20:04
@CLAassistant

CLAassistant commented Nov 23, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

devin-ai-integration[bot]

This comment was marked as resolved.

camcima and others added 2 commits November 23, 2026 15:11
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

No deployments
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.

Make the committer identity of refs/notes/ai commits configurable

3 participants