The following works for me on Fedora 14 using KDE, git version 184.108.40.206, and GNU Emacs 23.2.1 (x86_64-redhat-linux-gnu, GTK+ Version 2.21.4):
Add the following to your
cmd = emacs --eval \"(ediff-files \\\"$LOCAL\\\" \\\"$REMOTE\\\")\"
cmd = emacsclient --eval \"(ediff-files \\\"$LOCAL\\\" \\\"$REMOTE\\\")\"
Then, for example, you can use:
git difftool --tool=ediff --diff-filter=M tagname subdir
to view all the changed files (
--diff-filter=M) in the
subdir subdirectory of your working directory relative to the tag
tagname. This will open up a new emacs instance for each diff.
Alternatively, you can use:
git difftool --tool=ediffclient --diff-filter=M tagname subdir
to open the diffs in an existing instance of emacs (assuming you have emacsclient set up). After viewing each diff, you can quit ediff and press ENTER in the terminal you started to get the next diff.
To avoid having to press ENTER, use the
--no-prompt option (although I am not sure how well that will work with the ediffclient version).
The lines in
.gitconfig define a custom diff tool. You can also use other standard diff tools, including kompare (which I sometimes like) and emerge (which is an emacs merge tool, but which I don’t use often):
git difftool --tool=kompare --diff-filter=M tagname subdir
git difftool --tool=emerge --diff-filter=M tagname subdir
git-difftool for more options.
You can set the default diff tool by adding the following to
tool = ediffclient