[PATCH] parse diffs without timestamps

Robin Rosenberg robin.rosenberg.lists at dewire.com
Fri Aug 25 22:23:20 CEST 2006


Hi, 

Here is a small fix for kompare to recognize diffs without timestamps, such
as those from git or diff with the --label options. This fixes bugs 131717 and 
116637 (the former being a duplicate)

-- robin

---

 kompare/libdiff2/parserbase.cpp |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kompare/libdiff2/parserbase.cpp b/kompare/libdiff2/parserbase.cpp
index 13c4b32..303f7b2 100644
--- a/kompare/libdiff2/parserbase.cpp
+++ b/kompare/libdiff2/parserbase.cpp
@@ -63,8 +63,8 @@ ParserBase::ParserBase( const KompareMod
        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( "-(.*)" );

 


More information about the Kompare-devel mailing list