Summary: | can not parse multi-file unified diffs without "diff ...." lines | ||
---|---|---|---|
Product: | [Applications] kompare | Reporter: | Olivier Trichet <nive> |
Component: | parser | Assignee: | Kompare developers <kompare-devel> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | ana, esigra, will.angenent |
Priority: | NOR | ||
Version: | 3.4 | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: |
patch
Correction for r1028720 and r1028515 |
Description
Olivier Trichet
2006-12-25 16:23:49 UTC
Created attachment 19030 [details]
patch
This patch forces the parsing to consider unified header line not to be part of
remove/add lines.
I have applied the patch to latest Debian packages(3.5.8). It works. This means that https://bugs.kde.org/show_bug.cgi?id=152366 is a dupe of this one. SVN commit 938013 by bruggie: BUG: 139209 This is the best approach to fixing this bug. Thanks to Olivier Trichet for supplying the patch 2 years and almost 3 months ago :(. Sorry for this incredible long time. M +3 -1 parserbase.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=938013 SVN commit 944068 by kkofler: CCBUG: 139209 This is the best approach to fixing this bug. Thanks to Olivier Trichet for supplying the patch 2 years and almost 3 months ago :(. Sorry for this incredible long time. Backport revision 938013 by bruggie from trunk. M +3 -1 parserbase.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=944068 that patch is _not_ the way to fix this bug. the patch has introduced bug 208688, which is (in my estimation) significantly worse. The parser needs to respect the line counts in the diff header instead to avoid reading a diff header as diff content. https://bugs.kde.org/show_bug.cgi?id=208688 reverting fix, reopening. SVN commit 1028512 by je4d: Revert the fix for bug 139209 - the fix used caused bug 208688. 139209 needs to be fixed by counting lines instead. BUG:208688 CCBUG:139209 M +1 -3 parserbase.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1028512 SVN commit 1028515 by je4d: track line counts so that we don't interpret a diff header (--- file...) as a removal if there's nothing separating it from the last hunk of the previous diff. BUG: 139209 M +23 -16 parserbase.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1028515 SVN commit 1028516 by je4d: port bugfix from trunk: track line counts so that we don't interpret a diff header (--- file...) as a removal if there's nothing separating it from the last hunk of the previous diff. BUG: 139209 M +26 -12 parserbase.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1028516 SVN commit 1028719 by kkofler: Revert the fix for bug 139209 - the fix used caused bug 208688. 139209 needs to be fixed by counting lines instead. CCBUG:208688 CCBUG:139209 backport revision 1028512 by je4d from trunk M +1 -3 parserbase.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1028719 SVN commit 1028720 by kkofler: track line counts so that we don't interpret a diff header (--- file...) as a removal if there's nothing separating it from the last hunk of the previous diff. CCBUG: 139209 (The correct fix for #139209, which hopefully doesn't cause regressions.) backport revision 1028515 by je4d from trunk M +23 -16 parserbase.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1028720 There is a bug in the patch: lineCountA is assigned instead of lineCountB for the destination line count. This would cause a diff like this to fail to parse correctly: --- foo 2009-10-11 13:41:51.000000000 +0100 +++ bar 2009-10-11 13:41:57.000000000 +0100 @@ -1,7 +1,2 @@ a -b -c -d -e -f g The parsing ends prematurely since there are more deletions than insertions, and kompare only shows the line with 'b' as deleted. I'm attaching a patch to correct this. Created attachment 37509 [details]
Correction for r1028720 and r1028515
Whoops, thanks for spotting this, will apply ASAP. SVN commit 1033954 by kkofler: Fix typo spotted by Will Angenent (4.3.2 regression). CCBUG: 139209 M +1 -1 parserbase.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1033954 SVN commit 1033955 by kkofler: Fix typo spotted by Will Angenent (4.3.2 regression). CCBUG: 139209 backport revision 1033954 from trunk M +1 -1 parserbase.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1033955 Fixed in trunk and 4.3 branch, the fix will be in 4.3.3. Fixed Fedora packages (kdesdk-4.3.2-2.fc13, kdesdk-4.3.2-2.fc12, kdesdk-4.3.2-2.fc11, kdesdk-4.3.2-2.fc10) now building. Distros are strongly encouraged to apply the fix ASAP. Thanks again! |