[codex] Fix stale deferred rewrite state#1655
Open
svarlamov wants to merge 1 commit into
Open
Conversation
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
Fix stale deferred rewrite state for operations that apply changes now and consume attribution on a later
git commit.TestReporegressions for abandonedcherry-pick --no-commitand abandonedmerge --squashfollowed by an unrelated commit from the same base.Root Cause
merge --squashandcherry-pick --no-commitstored worktree-scoped pending state and later consumed it ongit commitusing only a weak base match. If the actual operation was abandoned without a traced daemon event, a later unrelated commit from that same base could inherit stale source session metadata.Validation
RED checks before the fix:
task test TEST_FILTER=test_cherry_pick_no_commit_abandon_does_not_affect_later_unrelated_commit NO_CAPTURE=truefailed on stale cherry-pick session metadata.task test TEST_FILTER=test_abandoned_squash_merge_does_not_affect_later_unrelated_commit NO_CAPTURE=truefailed on stale squash session metadata.GREEN checks after the fix:
task fmttask linttask test TEST_FILTER=test_cherry_pick_no_commit_abandon_does_not_affect_later_unrelated_commit NO_CAPTURE=truetask test TEST_FILTER=test_abandoned_squash_merge_does_not_affect_later_unrelated_commit NO_CAPTURE=truetask test TEST_FILTER=test_cherry_pick_no_commit_defers_to_final_commit_tree NO_CAPTURE=truetask test TEST_FILTER=test_prepare_working_log_simple_squash NO_CAPTURE=truetask test TEST_FILTER=cherry_pick:: NO_CAPTURE=truetask test TEST_FILTER=squash_merge:: NO_CAPTURE=truetask test