Using ediff as git mergetool

前端 未结 12 515
天命终不由人
天命终不由人 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:02

    Here's a variant of tarsius's setup. It handles when the ancestor file $BASE doesn't exist, and it allows you to abort the merge without trashing git's state about the conflict (by not automatically saving on exit). It also has newlines backslashed so that you can keep the formatting.

    [mergetool.ediff]
        cmd = emacs --eval \" \
    (progn \
      (setq ediff-quit-hook 'kill-emacs) \
      (if (file-readable-p \\\"$BASE\\\") \
          (ediff-merge-files-with-ancestor \\\"$LOCAL\\\" \\\"$REMOTE\\\" \
                                           \\\"$BASE\\\" nil \\\"$MERGED\\\") \
          (ediff-merge-files \\\"$LOCAL\\\" \\\"$REMOTE\\\" nil \\\"$MERGED\\\")))\"
    

提交回复
热议问题