Comments (12)
I've created a branch, merge-conflicts, where I've started working on this. So far, there's a new command, :LinediffMerge
, which tries to detect a merge area around the cursor and opens up the linediff buffers for the two areas.
One thing I hadn't considered, though, is what to do from there on. Sure, you have the two areas, but if you change them both, they're just going to change in their respective positions. How do you actually merge them?
The way I'm thinking right now is:
- You run
:LinediffMerge
on a merge conflict - You make changes to one or both linediff buffers
- You run the command
:LinediffPick
on one of the buffers - That buffer replaces the entire merge area
The :LinediffPick
command is not yet implemented, but what do you think of the idea, @m42e, @ipsquiggle? Would that be a reasonable workflow for you both?
from linediff.vim.
I've merged the branch with master (ironically enough, I had merge conflicts :)). The merge/pick commands should be available in master now as well, so I'll go ahead and close this issue.
from linediff.vim.
That seems like a pretty good idea. I'll think about adding a separate command that triggers this.
from linediff.vim.
This would be incredible! I hadn't even considered using linediff for these kinds of merges but it's current behaviour would already be super useful here. Having a variation that smartly parses this format and then replaces the block with the merged result would be beautiful.
from linediff.vim.
Well I had a problem, merging two tex documents and I could not find the difference (It was an uppercase instead of a lowercase letter) and I found this plugin.
from linediff.vim.
Yes, it's the kind of thing which, now that I think about it, would be best done in a 3 way merge. Given that that would be a whole new ball of wax, I think what you propose is sane as a workflow: see the two diffs, merge the changes into the one that is "closer to what I want", and then pick that one.
from linediff.vim.
Yes, it's the kind of thing which, now that I think about it, would be best done in a 3 way merge.
It depends, fugitive has three-way conflict resolution (just run :Gdiff
), but it confuses me more than it helps. At the moment I prefer to select conflicting chunks via LineDiff, make them look the same and remove one of them later. I guess it's because you can be "in context" of one of branches that is being merged and analyzing differences between that and something else is easier than thinking of three versions two of which are less familiar than the third one.
from linediff.vim.
I've implemented the :LinediffPick
command that I mentioned above. It seems to work, but I haven't tested it too deeply. Could you try it out and let me know how it goes?
from linediff.vim.
Thanks, @AndrewRadev! Works fine for me. One thing to think about is displaying labels from merge markers, I think it would be helpful to see them (not that it provides much context, but helps to ensure you're making right choice without switching to original tab).
from linediff.vim.
I'll see what I can do.
from linediff.vim.
Sorry it took so long to get around it, but I guess it just fell to the side and I promptly forgot about it. I've added labels to :LinediffMerge
that should prove useful. I was planning on directly merging the merge-conflicts
branch, but with this change, I figure I'll leave it around a bit longer and then merge. In my work, I'm currently dealing with a lot of merges, so I hope I won't forget about it this time.
from linediff.vim.
Sounds interesting.
I've only recently discovered this plugin, and it turned out to be useful by itself already.
JFI/btw: consider setting merge.conflictstyle = diff3
in Git's config, which gives you an extra hunk of context in the middle.
from linediff.vim.
Related Issues (20)
- E97: Cannot create diffs HOT 3
- Strange errors on :Linediff HOT 5
- Adding vim-repeat support HOT 2
- Linediff specific diffopts HOT 2
- Doesn't work with different source files. HOT 15
- Add diff screenshot to README HOT 1
- Undo changes HOT 4
- Problem with folds HOT 8
- Improvement: diff multiple blocks HOT 3
- Lineedit command? HOT 2
- Error messages due to backslashes on filepaths HOT 9
- Update the buffers after creation from original file? HOT 3
- Provide keybindings to jump between differences HOT 4
- Don't work in MacVim (GUI) HOT 3
- What OSS license is this governed by? HOT 2
- Vim patch 9.0.907 causes E1312 when temporary buffers are closed HOT 3
- Adjusting cursor position when diff starts HOT 2
- diff tab remains open after LinediffReset HOT 2
- How to set vertical split for "diff tab" HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from linediff.vim.