fix: normalize authorship notes before push#1381
Open
peckfly wants to merge 2 commits into
Open
Conversation
Contributor
Author
|
Addressed the review finding in 165c70d. When normalization uses a fetched tracking ref as the parent, it now builds the replacement notes tree from remote/base notes first and local notes second, so remote-only notes are preserved and local notes still win on conflicts. Added a regression test for the failed-merge hazard state where local refs/notes/ai lacks a remote-only note but normalization uses the remote tracking ref as parent. |
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.
Summary
Fixes #1376.
Some repositories can reject pushes to
refs/notes/aiwhen the notes history contains legacy git-ai generated commits with placeholder identities such asgit-ai@localor empty/non-conventional commit messages. This can leave authorship notes unable to sync even though the note contents themselves are valid.This change:
refs/notes/aifast-import commits with the repository's configured Git identity and a conventionalchore:subjectVerification
cargo fmt --checkcargo build --bin git-aicargo test --test integration refs_unit:: -- --nocapturecargo test --test integration push_authorship_notes -- --nocapturecargo test --test integration 'fetch_notes::' -- --nocapturecargo test --test notes_sync_regression -- --nocaptureNote:
cargo test --test integration fetch_notes -- --nocapturealso selects an unrelatedci_local_skip_fetchworktree test on this machine; that one failed because the installed Git does not supportgit worktree add --orphan. The targetedfetch_notes::tests passed.