6

How to solve the problem that KDiff adds extra blank lines when resolving merge conflicts? Changing the end line and encoding in the settings to any others does not help.

If before running git mergetool we have:

line1
line2
line3

then after starting and resolving the conflict:

line1

line2

line3
LANSELOT
  • 185
  • 2
  • 9
  • Can you inspect, with an editor able to display non printable characters for example, or using a hex dumper, what line endings you have in the original file, and what line endings you have in the result of kdiff merge ? – LeGEC Sep 14 '21 at 11:58
  • I have used both windows and unix line endings, the result is the same. Also tried setting up auto-detecting end lines – LANSELOT Sep 14 '21 at 12:34
  • I'm having the same problem (all my files have a single CR + LF pair line endings) – Cato Lommerud Sep 22 '21 at 08:09

2 Answers2

10

This is a bug introduced in KDiff3 version 1.8.6.

To fix it, uninstall your version of KDiff3 and install KDiff3 version 1.8.5. It should work.

Here is a link to download: https://download.kde.org/stable/kdiff3/

References:

EDIT: This bug is fixed in 1.9.5 as per https://bugs.kde.org/show_bug.cgi?id=442199

Aki
  • 2,818
  • 1
  • 15
  • 23
Mikołaj Waśniewski
  • 1,298
  • 14
  • 16
  • 1
    Still broken in 1.9.3 (at least on Windows) https://invent.kde.org/sdk/kdiff3/-/issues/26 – phuzi Nov 15 '21 at 11:12
  • The download link no longer contains any links to any 1.8.x versions – phuzi Nov 15 '21 at 11:20
  • The upcoming 1.9.4 fixes this. If you have 1.8.6 that's not an official release but It may well be affected. The 1.9 branch broke a few things. Unix style lines should work in 1.9.3 as a workaround. – wheredidthatnamecomefrom Nov 16 '21 at 18:46
  • Meanwhile here is a link for KDiff3 1.8.5 win 64: https://mirrors.ocf.berkeley.edu/kde/Attic/kdiff3/kdiff3-1.8.5-windows-64-cl.exe – Stas Nov 16 '21 at 19:43
4

FYI, I had this bug with 1.9.4. Upgrading to 1.9.5 fixes that.