Repository navigation
adapter/jj: avoid false conflict detection on literal marker text - #70
Merged
Merged
Conversation
added 2 commits
November 8, 2026 21:31
extract_snapshot_with_conflicts flagged a file as conflicted when any single merge-marker line appeared in its content. Legitimate files (docs, test fixtures) that contain text like '<<<<<<< HEAD' were silently excluded from the snapshot, so adjudication missed them. Require both an opening (<<<<<<<) and closing (>>>>>>>) marker to identify a real conflict region.
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.
Problem
JjAdapter::extract_snapshot_with_conflicts(src/adapter/jj.rs:231-233before this change) flagged a file as conflicted when any single merge-marker line appeared in its content:Legitimate files (documentation, test fixtures, tutorials) that contain marker-like text such as a bare
<<<<<<< HEADline were misclassified as conflicted and silently excluded from the snapshot. That means adjudication never saw those files and could miss real disputes involving them.Evidence (before fix)
New test
test_literal_marker_text_is_not_a_conflicted_filefailed against the old heuristic:Fix
Detect a conflict region by requiring both an opening marker (
<<<<<<<) and a closing marker (>>>>>>>) to be present (content_has_conflict_markers), instead of flagging on any single marker line. Real jj/git materialized conflicts always form such a region; a lone marker in normal content does not.Verification
cargo test adapter::jj::tests --lib: 6 passed, 0 failed (includes the new literal-marker and real/diff3 conflict cases).cargo test(full suite): 98 passed, 3 failed — the 3 failures arestore::tests::test_plaintext_guard_reports_cleanup_failure,test_plaintext_paths_refuse_on_stat_errors,test_remove_now_attempts_every_path, all permission-based tests that fail when run as root (EACCES/chmod restrictions are bypassed). They are unrelated to this change (git difftouches onlysrc/adapter/jj.rs) and reproduce independently of it in a root environment.