merge-conflicts
merge-conflicts copied to clipboard
Add option to ignore a conflict ("manual" mode)
This package is a great way to resolve merge conflicts. It makes the whole process a lot faster.
However, quite often merging is a lot more complex than just picking "ours" or "theirs"; sometimes you want a bit of each, but not everything (like with "ours then theirs").
It would be nice to be able to ignore a particular conflict (or an entire file), and manually edit the conflict. Currently, I have to quit merge-conflicts, manually edit the conflict, and re-detect for the rest of the conflicts.
This could be bound to ctrl-m, i (i for ignore) and perhaps ctrl-m, shift-i to ignore an entire file?
I started working on this, but having never worked with either CoffeeScript or an Atom package, I didn't get any further than destroying the conflict markers. This means that the conflict isn't marked as resolved, and merge-conflicts never sees the merge as being finished.
Ideally, ignoring a conflict would not mark it as being resolved, but would instead reduce the total amount of merge conflicts.
I feel a little out of my depth with CoffeeScript's syntax, emitters, callbacks, etc. Someone else could probably get this done much faster, but I can work on it if no one else volunteers (and if you guys think this is a good feature to have?).
Thanks for developing a great package!
This sounds pretty reasonable to me. One question though: what does this let you do that "Resolve: Ours Then Theirs" and editing the resolved lines doesn't? The only difference that I can think of is that "Resolve: Ignore" would leave the conflict marker lines (<<<<, >>>>) in place, while "Resolve: Ours Then Theirs" deletes them. It's quite possible I'm just being thick, though :wink:
I started working on this, but having never worked with either CoffeeScript or an Atom package, I didn't get any further than destroying the conflict markers. [...] I feel a little out of my depth with CoffeeScript's syntax, emitters, callbacks, etc. Someone else could probably get this done much faster, but I can work on it if no one else volunteers (and if you guys think this is a good feature to have?).
Oh wow, thanks for giving it a shot!
It's not you - this package was my learning project for CoffeeScript, Node.js, and Atom, and I've been applying band-aids to keep up with the Atom API since the earliest days of the Atom beta, so the source is more than a little murky and disorganized. I've got #140 open as a start to refactoring and reorganizing things to make it a bit cleaner. Hopefully that'll make things a little easier.
I didn't mean to say that the code is bad, it's not; it's mostly CoffeeScript's syntax, which seems a bit alien to me (I'm mostly used to C++ and Lua). I should probably go through a couple of tutorials. ;)
Yes, this would be essentially the same as "Resolve: Ours Then Theirs" except it would leave the conflict markers (text, not graphical) in place.
This is useful if the conflict is longer than a few lines on each side. Otherwise it's easy to lose track of where the conflict actually was, and accidentally change something outside of the conflict.
Maybe the best way to do this would be to hide the graphical conflict markers, but keep a "Mark as resolved" button? That way the conflict wouldn't really be "ignored", but it would allow for manual conflict resolution. This would also keep the progress bar as-is, the total amount of conflicts wouldn't suddenly change, etc.
This is useful if the conflict is longer than a few lines on each side. Otherwise it's easy to lose track of where the conflict actually was, and accidentally change something outside of the conflict.
Ah, gotcha :+1:
You can edit the diff content on either side before you resolve, of course, including copying and pasting bits from the other side and mixing them together.
I also like this as a safety valve for conflicts that are misparsed for whatever reason, or that cause crazy graphical glitches, or for bits of your README that look like conflict markers but are actually intended to be there :grin:
Maybe the best way to do this would be to hide the graphical conflict markers, but keep a "Mark as resolved" button? That way the conflict wouldn't really be "ignored", but it would allow for manual conflict resolution. This would also keep the progress bar as-is, the total amount of conflicts wouldn't suddenly change, etc.
I think I like the original idea better: invoking the Resolve: Ignore action "un-detects" a conflict entirely (and having another action to ignore entire files at a time). If I'm remembering things right it should be a bit easier to set up, too.
I am definitely on board with this, by the way :+1: I can tackle it the next time I'm hacking on this, but they may not happen for a while, so if anyone beats me to it with a PR I'd be happy to review and such.