-
-
Save zecho/cf8a79d9025953d20d5111313e9b1b6a to your computer and use it in GitHub Desktop.
Use Emacs in ediff to resolve vcs conflicts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
[ -z "$MYEMACSCLIENT" ] && MYEMACSCLIENT="emacs" | |
# $1=$BASE, $2=$LOCAL, $3=$REMOTE, $4=$MERGED | |
if [ "$MYEMACSCLIENT" = "emacs" ]; then | |
$MYEMACSCLIENT -nw -Q --eval "(setq startup-now t)" -l "$HOME/.emacs.d/init.el" --eval "(progn (setq ediff-quit-hook 'kill-emacs) (if (file-readable-p \"$3\") (ediff-merge-files-with-ancestor \"$1\" \"$2\" \"$3\" nil \"$4\") (ediff-merge-files \"$2\" \"$3\" nil \"$4\")))" | |
else | |
$MYEMACSCLIENT -nw --eval "(progn (setq ediff-quit-hook 'kill-emacs) (if (file-readable-p \"$3\") (ediff-merge-files-with-ancestor \"$1\" \"$2\" \"$3\" nil \"$4\") (ediff-merge-files \"$2\" \"$3\" nil \"$4\")))" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment