views:

140

answers:

2

I have setup git diff to wrap into vimdiff (using this guide) and it's working as expected unless there are many files with changes. When there are multiple files with changes and I run git diff, it opens the first file and after quitting the first instance of vimdiff I'm presented with the following message: "external diff died, stopping at filename"

This is a completely different behavior than I am used to. I had a similar setup in the past with svn and when diffing against multiple files I would :wq after reviewing the first file and the next file with differences would open up. This is not the case with git. I have tried :n[ext], but doing so does not fill the left window with the original file so that it can be diffed against the modified version.

Thanks for any help.

+2  A: 

You can try git difftool, it is designed to do this stuff.

First, you need to config diff tool to vimdiff

git config diff.tool vimdiff

Then, when you want to diff, just use git difftool instead of git diff. It shall work as you expect.

czchen
Almost there! Modified a bit it's exactly what I'm looking for. +1 though!
chuckg
The vimdiff mergetool has recently been updated: http://git.kernel.org/?p=git/git.git;a=commit;h=829ef383a2b03a614d7d23e575270f2b10a805c1 (and a few other commits, but that's the biggest one). Not sure when the next maintenance release will be, but if you're willing to build from git.git, upgrades shall be yours!
Jefromi
+2  A: 
git config --global diff.tool vimdiff
git config --global difftool.prompt false
git config --global alias.d difftool

Typing git d yields the expected behavior, type :wq in vim cycles to the next file in the changeset.

chuckg