Skip to content

feat: resolve a conflicted file conflict by conflict, with both sides next to each other and the result below - #21

Merged
Lars- merged 1 commit into
mainfrom
feat/three-way-conflicts
Nov 5, 2026
Merged

Lars- merged 1 commit into
mainfrom
feat/three-way-conflicts

Conversation

@Lars-

@Lars- Lars- commented Nov 5, 2026

Copy link
Copy Markdown
Owner

What this changes

Clicking a conflicted file (one both sides changed) now opens it in the centre to resolve conflict by conflict: our side and theirs next to each other with every conflict lined up, and below them the result as it will be saved. For the conflict on screen you take ours, theirs or both (ours first); GitCraft then moves on to the next conflict without a pick. Previous and Next, or a click on a conflict's heading, go to any conflict, and the lists scroll to it. Save and mark resolved writes the result and adds the file once every conflict has a pick; the file then leaves the list and the bar's Continue becomes available.

It reads the conflict markers git wrote into the file, so it works for merges, rebases, cherry-picks and reverts, with merge.conflictStyle merge, diff3 or zdiff3 (the common ancestor is left out), and keeps the file's line endings. When the file changes outside GitCraft, it is read again; when its markers are gone (resolved in an editor), the view closes and says to mark it resolved or take a side. A file one side deleted keeps its Ours and Theirs buttons, as before.

Roadmap: "Conflicts, part 2".

How it is tested

  • conflict.rs unit tests: splitting at the markers, the diff3 ancestor left out, CRLF and a missing last newline kept, markers outside a conflict or of the wrong length ignored, unbalanced markers rejected, and resolving only once every conflict has a pick.

  • Core test against a real merge with two conflicts: read, resolve with theirs and both, save, continue the merge; a file without markers and a missing file give their own errors.

  • App tests through the accessibility tree: resolve two conflicts (moving on by itself, going back through a heading, Save disabled until every conflict has a pick), save and continue the merge; and a conflicted file edited outside drops its pick, then closes with an explanation once its markers are gone.

  • Tried in the app: a merge with two conflicts in a Rust file and a rebase of a 300-line file with three conflicts far apart (the lists scroll to each), saved and continued.

  • cargo fmt --all, cargo clippy --workspace --all-targets -- -D warnings and cargo test --workspace pass

  • It adds as little code as the change needs, and removes what it makes unnecessary

  • Nothing in it comes from GitKraken or another closed-source client (see CONTRIBUTING.md)

@Lars-
Lars- merged commit 5e3b31e into main Nov 5, 2026
7 checks passed
@Lars-
Lars- deleted the feat/three-way-conflicts branch November 5, 2026 10:18
@Lars- Lars- mentioned this pull request Nov 5, 2026
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.

1 participant