git difftool gives strange results with staged and also unstaged changes

272 Views Asked by At

meld (for example) is selected for git difftool invocation:

git config --list | grep diff

gives:

diff.tool=meld

I have one file with only staged changes, and another file with unstaged changes.

When I run git difftool, I expect only the unstaged changes to be shown (with meld). But to my surprise, I see that git diff --cc xxx_file_with_staged_changes_xxx is invoked, just before the expected meld invocation for the file with only unstaged changes.

Yet, the GIT manual states that:

git diff [--options] [--] […​] This form is to view the changes you made relative to the index (staging area for the next commit). In other words, the differences are what you could tell Git to further add to the index but you still haven’t. You can stage these changes by using git-add[1].

So only the unstaged changes should be shown, no? And note the strange git diff invocation produced by git difftool in my case, just before the expected invocation of the "difftool" (here, meld).

0

There are 0 best solutions below