-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new merge conflicts menu and move the previous external merge tool there #3477
base: master
Are you sure you want to change the base?
Conversation
…l there Also add options for `git checkout --theirs` and `git checkout --ours` Fixes jesseduffield#2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good start, but it needs some more work.
- 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. - I find the terms
theirs
andours
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 usesHEAD (Current Change)
for ours andIncoming Change
for theirs, which I find a little better. At the very least we should have good tooltips that explain this well. - 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. 😄)
{ | ||
Label: self.c.Tr.CheckoutOurs, | ||
OnPress: func() error { | ||
return self.c.Git().WorkingTree.CheckoutOurs(self.context().GetSelected().Name()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This only works for top-level files. You want GetPath()
instead of Name()
so that it also works for files in folders.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And you should call self.c.Helpers().MergeAndRebase.CheckMergeOrRebase(err)
after this; this will cause any files that no longer have conflicts to be staged, and if no conflicting files are left, it will prompt to continue the rebase.
I'll look into that - and I didn't quite cheat, I just didn't see that my |
Also add options for
git checkout --theirs
andgit checkout --ours
Fixes #2026
go generate ./...
)docs/Config.md
) have been updated if necessary