fix: notes merge fallback and retry for busy monorepos#815
Draft
fix: notes merge fallback and retry for busy monorepos#815
Conversation
When `git notes merge -s ours` crashes (assertion failure in notes-merge.c due to mixed-fanout trees or version-specific bugs), fall back to a fast-import based merge that produces a clean notes tree in a single process invocation. Also adds a retry loop (up to 3 attempts) for the full fetch-merge-push cycle to handle concurrent push races on busy monorepos where the remote notes ref moves between merge and push. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
cargo fmt, and pass -c user.name/user.email in git_plumbing() so commit-tree works in CI where no global git identity is configured. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
9656775 to
56b0a07
Compare
derive_directory_from_url only checked for '/' as a path separator, so on Windows local paths like C:\path\to\repo.git it fell through to the ':' (SCP-like) check and matched the drive letter colon, producing an incorrect target directory. Now checks both '/' and '\\'. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
git notes merge -s ourscrashes (assertion failure in git's notes-merge.c on corrupted/mixed-fanout trees)Test plan
test_push_authorship_notes_survives_corrupted_remote_notes_tree— reproduces the exact assertion crash, verifies fallback succeedstest_push_authorship_notes_retries_on_concurrent_push— simulates concurrent push race, verifies retry loop succeedstest_fetch_and_push_authorship_notes_internal_commands_jsonstill passes🤖 Generated with Claude Code