Using ediff as git mergetool

前端 未结 12 503
天命终不由人
天命终不由人 2020-12-12 10:22

I would like to be able to use ediff with \"git mergetool\".

I found some patches that alter the source code, which I don\'t want to do. Instead, I\'d like to add ed

12条回答
  •  伪装坚强ぢ
    2020-12-12 11:16

    This was a valuable find for me. I have a small addition, since I use emacs desktop-save-mode:

    [mergetool "ediff"]
    cmd = emacs --no-desktop -eval \"(ediff-merge-files-with-ancestor \\\"$PWD/$LOCAL\\\" \\\"$PWD/$REMOTE\\\" \\\"$PWD/$BASE\\\" nil \\\"$PWD/$MERGED\\\")\"
    

    and added the "(when" clause below, because I prefer a multi-frame ediff normally:

    ;;
    ;; Setup for ediff.
    ;;
    (require 'ediff)
    
    (when (or (not desktop-save-mode) (member "--no-desktop" command-line-args))
          (defvar ediff-after-quit-hooks nil
           ... (rest of TauPan's code here) ...
    )
    

提交回复
热议问题