4

After updating emacs (to 25.2.2 as shipping in ubuntu 18.04) I notice a change that completely breaks my conflict resolution flow in git. Once I resolve a conflict using emacs and save the file, emacs automatically does "git add" on the file. This may seem convenient but it removes the chance to see the resulting "3-way conflict diff" (I have no idea what this is really called in git speak).

Is there a way to disable this auto-add of the resolved file? I have tried disabling smerge-mode in the buffer before saving but that does not seem to help. I can't even figure out which mode is doing the actual auto-add either.

On further investigation the problematic behaviour seems to be caused by the vc-git-resolve-when-done hook. So the question seems to be how to disable this after-save-hook.

  • You should make your comment an answer and then accept it. That marks the question as "answered" and helps future visitors when they search. – NickD Jun 23 '19 at 16:57
  • Now that you have made it into an answer, please accept it (assuming of course that it does what you want :-) ): just tick the tick mark on the left. – NickD Jun 24 '19 at 14:31
4

This behaviour is controlled by the vc-git-resolve-conflicts variable. Setting this to nil removes automatic git-add after conflict resolution.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.