3

I'm trying to do something which I think should be simple. I have two old commits in the log, X and Y (where X and Y are commit hashes). I want to see a visual, Directory representation of the differences between the two commits, so I run:

git difftool -d X Y

But this gives me a large number of differences which are not between the two commits.

If I create a brach b1 from X and a branch b2 from Y, then the command works as expected (git difftool -d b1 b2).

Can someone please explain my error in execution and thinking?

Spacemoose
  • 3,856
  • 1
  • 27
  • 48

1 Answers1

2

As far as I'm aware, there should be no difference in behaviour whether you specify the commits by SHA-1 object name or by branch name (see SPECIFYING REVISIONS in the reference for gitrevisions), so this looks like it might be a bug.

Do you get the correct diff if you use git difftool instead of git difftool -d? How about if you use git diff? (All three should give the set of changes--just displayed differently.) Maybe also try using a different tool for actually carrying out the diff?

Rich
  • 7,348
  • 4
  • 34
  • 54