Skip to content
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

FR: Alternative conflict marker settings #3776

Closed
ChrisPenner opened this issue May 28, 2024 · 2 comments
Closed

FR: Alternative conflict marker settings #3776

ChrisPenner opened this issue May 28, 2024 · 2 comments

Comments

@ChrisPenner
Copy link

Is your feature request related to a problem? Please describe.
I generally find that most conflict resolution programs are too heavy-weight or get in the way, so I usually just open the conflicts in vim and handle them that way. jj has a novel way of describing conflicts, which I really want to like, but after trying it out for a while it causes a few problems for me.

E.g. in a (completely contrived) conflict like this:

<<<<<<<
+++++++
  when shouldSave do
    saveFile (Just FollowSymlinks) filePath
    print "Saved!"
%%%%%%%
   when shouldSave do
-    saveFile Nothing filePath
+    atomicSaveFile Nothing filePath
     print "Saved!"
>>>>>>>
  1. It seems that the %%%%%% portion, which is diffed from the base, inserts indentation at the beginning of all the lines, this means that even if I remove all the + and -'s I still need to fix the indentation of the block to match the surrounding code, which is especially important/annoying in white-space sensitive languages.

  2. I have a really hard time figuring out which changes are from which revision

Describe the solution you'd like
I'd love the option to have jj insert labelled conflict markers similar to Git's traditional 3-way diff and just include each of the revisions as-is without the clever diffing. I know jj can have an arbitrary number of parents, but that's fine, just insert the code from each parent revision without any diffing :)

<<<<<<< cro -- MERGE BASE
  when shouldSave do
    saveFile Nothing filePath
    print "Saved!"
+++++++ lsk -- Make save follow symlinks
  when shouldSave do
    saveFile (Just FollowSymlinks) filePath
    print "Saved!"
+++++++ soq -- Make saving atomic
  when shouldSave do
    atomicSaveFile Nothing filePath
    print "Saved!"
>>>>>>>

I'd of course be fine with this being a configuration option, since I'm sure some folks are happy with the current behaviour.

Describe alternatives you've considered
Conflict resolution is difficult, I'm sure there are dozens of variations which could also solve this issue, but I think something close to git's 3-way diff makes sense here :)

Thanks for all the work you've put in, it's refreshing to see a new take in this space 😄

@PhilipMetzger
Copy link
Collaborator

There's already a FR for Git styled conflict markers here: #823

@martinvonz
Copy link
Owner

I'll close this because it seems like a duplicate. Feel free to reopen if you think it's different.

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

No branches or pull requests

3 participants