Skip to content

feat: continue, skip or abort a stopped merge, rebase, cherry-pick or revert, and resolve conflicted files by side - #19

Merged
Lars- merged 1 commit into
mainfrom
feat/conflicts
Nov 4, 2026
Merged

Lars- merged 1 commit into
mainfrom
feat/conflicts

Conversation

@Lars-

@Lars- Lars- commented Nov 4, 2026

Copy link
Copy Markdown
Owner

What this changes

The first part of the roadmap item Conflicts. When a merge, rebase, cherry-pick or revert stops half way, GitCraft now says so and offers the way on:

  • A bar under the toolbar names what is in progress (Merge in progress, with the message of the commit it will make) and counts the conflicted files. Continue is enabled once every conflict is resolved, Skip leaves out the commit it stopped at (not for a merge, which has none), Abort goes back to where it started. It shows up for operations started on the command line too, through the live refresh.
  • Each conflicted file in the uncommitted changes gets Ours, Theirs and Mark resolved on a line below its name, so the name stays readable in a narrow panel. Ours and Theirs take the whole file from that side with git restore --source --staged --worktree, which resolves it in one step. When that side deleted the file they delete it with git rm instead; the tooltip says which of the two a button does.
  • Undo and Redo are off while something is in progress (a soft reset in the middle of a merge fails anyway).

How it works:

  • Repo::underway reads what is in progress from the files git leaves in the git directory (gitoxide's state()), plus the first line of MERGE_MSG. It also says which commit is "theirs": MERGE_HEAD, REBASE_HEAD, CHERRY_PICK_HEAD, or the parent of REVERT_HEAD for a revert.
  • Change::Conflicted now says whether ours and theirs still have the file, read from the stage modes in git status --porcelain=v2 (000000 means none).
  • New ops: Restore, Remove, and Continue, Skip and Abort with the command they carry on.

Still to come (part 2, next in the roadmap): a three-way view to resolve a file conflict by conflict. Until then, clicking a conflicted file does not open a diff, because git diff shows conflicts in a combined format the diff view does not read yet.

How it is tested

  • Core resolve_conflicts_and_continue_a_merge: a merge with a content conflict and a modify/delete conflict; what is under way and its message; the conflicted files with which side has them; nothing to undo half way; Continue fails while conflicts remain; take theirs for one file, delete the other as ours did, Continue makes the merge commit.

  • Core skip_abort_and_continue_a_rebase_a_cherry_pick_and_a_revert: the sides turn around in a rebase (the file deleted by the commit coming in), Skip leaves out the commit; Abort puts a cherry-pick back; for a revert, theirs is the commit before the reverted one, and Continue makes the revert commit.

  • App: take_their_side_of_a_conflict_and_continue_the_merge (bar, count, Continue disabled, no Skip for a merge), mark_a_conflict_resolved_and_continue_the_rebase (edit the file, Mark resolved, Continue) and abort_a_cherry_pick_that_stopped_at_a_conflict.

  • Status parser: a deleted-by-us record, and a cut-off u record is rejected.

  • Tried in the app on Linux: a merge with a content and a modify/delete conflict resolved with Theirs and Ours (deleting the file) and continued; a rebase started on the command line shows up by itself with Skip, and Abort puts the branch back.

  • No change to the history benchmarks: reading what is in progress costs a few file checks per reload.

  • 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)

… revert, and resolve conflicted files by side
@Lars-
Lars- merged commit 51031ab into main Nov 4, 2026
7 checks passed
@Lars-
Lars- deleted the feat/conflicts branch November 4, 2026 10:23
@Lars- Lars- mentioned this pull request Nov 4, 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