Git diff -cc mode won't be displayed by difftool
Asked Answered
S

1

9

I'm not sure what's going on but I just set up my diff tool to be called by git difftool, yet the very first file difftool encounters is displayed in the standard diff manner - on the console with line-by line replacements

diff --cc path/to/file.c
index ac1b99f,da29e2e..0000000
--- a/path/to/file.c
+++ b/path/to/file.c
@@@ -186,18 -133,20 +188,18 @@@

   code code code code
   more code more code more code
-- old code old code old code [displayed in red]
++ new code new code new code [displayed in green]
   even more code even more code 
   yet more code yet more code

This seems to be a special case of a diff as it has the --cc flag and a triple @ symbol (@@@ ) instead of a double one (@@), and most importantly a strange description of the revisions being diffed : hash1,hash2..0000000.

What exactly is this ? I chose Beyond Compare as my diff tool, can it handle those cases ? If not, might another be able to do so ?

Suanne answered 7/3, 2019 at 10:12 Comment(0)
S
3

Combined diffs are peculiar to Git and generally not available anywhere else.

Git doesn't know how to invoke other commands to have them produce combined diffs, even if some other command would be able to do it.

(Git describes how to read combined diffs in one section of the various git diff documentation, and leaves out a crucial fact: combined diffs usually omit most of the differences. This fact is mentioned elsewhere in the documentation, far from the part one studies when trying to understand how to read a Git combined diff. Anyway, combined diffs are only really good for inspecting the merge-y parts of merges.)

Subequatorial answered 7/3, 2019 at 17:44 Comment(3)
I didn't try it personally, boot gitkraken tool is probably capable of displaying combined diffs: support.gitkraken.com/working-with-commits/diff/…Epidote
The only place in the git documentation I could find the difference between -c and --cc was under man git-diff-tree.Mazarin
@user1071847: the documentation is continuously being improved, but there's still not a good description of these yet.Subequatorial

© 2022 - 2024 — McMap. All rights reserved.