git whatchanged with vimdiff

438 Views Asked by At

I would like to see the changes I am pushing with vimdiff. I can see the changes before commit with $ git diff configuring vimdiff to ~/.gitconfig.

After commits, I can see the commits with --patch switch on whatchanged command,

$ git whatchanged origin/master.. --patch

But, with this command the changes are displayed in default vim, and I want to see the changes in vimdiff with two vertical columns.

Reference

Stackoverflow question View last N to M Git commits in vimdiff seems to address my question(at least the title), but I got no clue with the answers there(maybe too nerdish).

Google search didn't show me proper results.

1

There are 1 best solutions below

0
On

It is new to me too, so I tried to adapt the code from View last N to M Git commits in vimdiff.

f=myFile.txt
vimdiff <(git show HEAD^1:"$f") $f

So simply feed vimdiff both files, this shows the last commit (iow. git show) for one file. The other thread shows how to do it for a range of commits.

I suppose whatschanged and other frontend commands would need some additional options to iterate their diffs per file, but I have not looked at this.