lazygit icon indicating copy to clipboard operation
lazygit copied to clipboard

Add new merge conflicts menu and move the previous external merge tool there

Open recht opened this issue 1 year ago • 1 comments

Also add options for git checkout --theirs and git checkout --ours

Fixes #2026

  • Please check if the PR fulfills these requirements
  • [x] Cheatsheets are up-to-date (run go generate ./...)
  • [x] Code has been formatted (see here)
  • [x] Tests have been added/updated (see here for the integration test guide)
  • [x] Text is internationalised (see here)
  • [x] Docs (specifically docs/Config.md) have been updated if necessary
  • [x] You've read through your own file changes for silly mistakes etc

recht avatar Apr 05 '24 22:04 recht

This is a good start, but it needs some more work.

  1. Most importantly, it should support range selection. It should be possible to press shift-down-arrow to select multiple files, and then checkout theirs or ours for all of them. This raises the question of what happens if you select both a folder, and some of the files inside it; it seems that you should be able to call normalisedSelectedNodes which was introduced for a similar situation.
  2. I find the terms theirs and ours problematic; they are intuitive for a merge conflict, but they appear swapped for a conflict in a rebase. I know that we usually want to stay close to the terms that git CLI uses, but in this case even git CLI admits that the terms can be confusing (there's a long section in the documentation about it). VS Code's conflict browser uses HEAD (Current Change) for ours and Incoming Change for theirs, which I find a little better. At the very least we should have good tooltips that explain this well.
  3. It would be really good to have some integration tests for this. (You ticked the "Tests have been added/updated" in the PR description, that was cheating. 😄)

I'll look into that - and I didn't quite cheat, I just didn't see that my git push failed 🤦🏼

recht avatar Apr 07 '24 10:04 recht