Created
July 25, 2011 12:27
-
-
Save TauPan/1104020 to your computer and use it in GitHub Desktop.
Viewing differences in git with emacs-ediff
This file contains hidden or 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 | |
# adapted from http://technotales.wordpress.com/2009/05/17/git-diff-with-vimdiff/ | |
if [ -n "${GIT_EXTERNAL_DIFF}" ]; then | |
[ "${GIT_EXTERNAL_DIFF}" = "${0}" ] || | |
{ echo "GIT_EXTERNAL_DIFF set to unexpected value" 1>&2; exit 1; } | |
exec emacsclient --eval "(ediff \"$2\" \"$5\")" | |
else | |
GIT_EXTERNAL_DIFF="${0}" exec git --no-pager diff "$@" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment