Summary: | kompare won't parse diffs from git | ||
---|---|---|---|
Product: | [Applications] kompare | Reporter: | Andy Parkins <andyparkins> |
Component: | general | Assignee: | Kompare developers <kompare-devel> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | eyal.lotem |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Debian testing | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
Andy Parkins
2006-08-02 12:06:11 UTC
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( "-(.*)" ); |