Version: (using KDE KDE 3.5.3) Installed from: Debian testing/unstable Packages Kompare just shows blank for diffs redirected from git. I've tracked down the cause and it seems to be on the file declaration lines. Here is a sample diff that kompare will not show. diff --git a/file b/file index a8b2ec6..a1e65fd 100644 --- a/file +++ b/file @@ -1,2 +1,3 @@ initial contents goes in master branch additional content added in repo1#master +blah As you can see, it's a simple addition of the line "blah". Kompare shows this diff as blank. Now if I modify the file so that the "---" and "+++" lines both have "<tab>(something)" added: diff --git a/file b/file index a8b2ec6..a1e65fd 100644 --- a/file (anything can go here) +++ b/file (anything can go here) @@ -1,2 +1,3 @@ initial contents goes in master branch additional content added in repo1#master +blah Kompare will correctly show this diff.
What kind off diff are you using? When I try to reproduce: diff --git kb.txt kb1.txt diff: unrecognized option `--git' diff: Try `diff --help' for more information. diff -v diff (GNU diffutils) 2.8.7 Written by Paul Eggert, Mike Haertel, David Hayes, Richard Stallman, and Len Tower.
Sorry, I've just realised that I wasn't clear. Those quotes aren't diff command lines they are output from commands like $ git diff That is to say, http://git.or.cz/ the version control system. The "diff --git" lines are part of git's diff output - not a command line. To help you reproduce, try the following after installing git (apt-get install git-core) $ mkdir temp; cd temp $ git init-db $ echo "some text" > somefile $ git add somefile $ git commit -a -m "Commit a file" $ echo "some changed text" > somefile $ git diff diff --git a/somefile b/somefile index 7b57bd2..1737c03 100644 --- a/somefile +++ b/somefile @@ -1 +1 @@ -some text +some changed text $ git diff | kompare - After that last call, kompare just shows a blank page. Hope that describes the problem in a more understandable way :-)
I think it's because kompare's parser expects the timestamps & whatnot on the ---/+++ lines. I think this bug is a dupe, but I can't remember what the title of the other one is. - Jeff
*** Bug 116637 has been marked as a duplicate of this bug. ***
SVN commit 579134 by stoecker: BUG: 131717 Fixed trouble with missing timestamps from git diff (patch by Robin Rosenberg). M +2 -2 branches/KDE/3.5/kdesdk/kompare/libdiff2/parserbase.cpp M +2 -2 trunk/KDE/kdesdk/kompare/libdiff2/parserbase.cpp --- branches/KDE/3.5/kdesdk/kompare/libdiff2/parserbase.cpp #579133:579134 @@ -63,8 +63,8 @@ m_normalHunkBodyAdded.setPattern ( "> (.*)" ); m_normalHunkBodyDivider.setPattern ( "---" ); - m_unifiedDiffHeader1.setPattern ( "--- ([^\\t]+)\\t([^\\t]+)(?:\\t?)(.*)\\n" ); - m_unifiedDiffHeader2.setPattern ( "\\+\\+\\+ ([^\\t]+)\\t([^\\t]+)(?:\\t?)(.*)\\n" ); + m_unifiedDiffHeader1.setPattern ( "--- ([^\\t]+)(?:\\t([^\\t]+)(?:\\t?)(.*))?\\n" ); + m_unifiedDiffHeader2.setPattern ( "\\+\\+\\+ ([^\\t]+)(?:\\t([^\\t]+)(?:\\t?)(.*))?\\n" ); m_unifiedHunkHeader.setPattern ( "@@ -([0-9]+)(|,([0-9]+)) \\+([0-9]+)(|,([0-9]+)) @@(?: ?)(.*)\\n" ); m_unifiedHunkBodyAdded.setPattern ( "\\+(.*)" ); m_unifiedHunkBodyRemoved.setPattern( "-(.*)" ); --- trunk/KDE/kdesdk/kompare/libdiff2/parserbase.cpp #579133:579134 @@ -63,8 +63,8 @@ m_normalHunkBodyAdded.setPattern ( "> (.*)" ); m_normalHunkBodyDivider.setPattern ( "---" ); - m_unifiedDiffHeader1.setPattern ( "--- ([^\\t]+)\\t([^\\t]+)(?:\\t?)(.*)\\n" ); - m_unifiedDiffHeader2.setPattern ( "\\+\\+\\+ ([^\\t]+)\\t([^\\t]+)(?:\\t?)(.*)\\n" ); + m_unifiedDiffHeader1.setPattern ( "--- ([^\\t]+)(?:\\t([^\\t]+)(?:\\t?)(.*))?\\n" ); + m_unifiedDiffHeader2.setPattern ( "\\+\\+\\+ ([^\\t]+)(?:\\t([^\\t]+)(?:\\t?)(.*))?\\n" ); m_unifiedHunkHeader.setPattern ( "@@ -([0-9]+)(|,([0-9]+)) \\+([0-9]+)(|,([0-9]+)) @@(?: ?)(.*)\\n" ); m_unifiedHunkBodyAdded.setPattern ( "\\+(.*)" ); m_unifiedHunkBodyRemoved.setPattern( "-(.*)" );