Reputation: 14306
I'm using kdiff3 as a difftool. When I use git difftool command it also shows me the files that are exactly the same. Even kdiff3 pops up a message that the files are "binary equal" (they are text files though). Is there a way to avoid displaying unchanged files?
Upvotes: 3
Views: 3702
Reputation: 968
I was having the same issue with Beyond Compare as my difftool. For me, this was a line endings issue.
I noticed that the when I ran git diff (instead of git difftool) the same files that I saw showing up with no changes in Beyond Compare were showing up with the messages
warning: LF will be replaced by CRLF in <path to file>
The file will have its original line endings in your working directory.
You might say "But wait, I know it isn't a line endings issue because when I open it up in Kdiff3, it doesn't show any line ending changes." That has to do with the "The file will have its original line endings in your working directory" part of that warning message.
I consider myself a pretty competent git user, but I'll admit that I've never had the courage to really dig into how it handles line ending changes. So I don't know all the details but I know that git can do some behind the scenes magic to show you the line endings that your OS likes even if that's not exactly what is stored in the repository.
I was able to get around the weird files by following these instructions and making my .git/info/attribute file look like this:
* -crlf
Upvotes: 1
Reputation: 1144
Maybe you have enabled some Preprocessor command in Diff(under Config), that's why the binary maybe same.
If you want to hide them then you need to do Full analysis under Directory -> File Comparison Mode (Full analysis). It would hide the processed files.
But first step is to check it in another diff application (as usual make sure the file endings are matched or ignored).
Upvotes: 0