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 
3
  • 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 ? Commented Sep 14, 2021 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 Commented Sep 14, 2021 at 12:34
  • I'm having the same problem (all my files have a single CR + LF pair line endings) Commented Sep 22, 2021 at 8:09

2 Answers 2

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

Sign up to request clarification or add additional context in comments.

6 Comments

Still broken in 1.9.3 (at least on Windows) invent.kde.org/sdk/kdiff3/-/issues/26
The download link no longer contains any links to any 1.8.x versions 😕
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.
Meanwhile here is a link for KDiff3 1.8.5 win 64: mirrors.ocf.berkeley.edu/kde/Attic/kdiff3/…
3 years later, I've just had this same issue whilst trying the latest current version for Windows (1.12.70) - it opens all files with blank lines between each line, no matter which encoding or line ending settings I choose. The link from @Stas for 1.8.5 above worked fine, so seems like it's been broken again.
Same for me on Windows 11 with KDiff3 1.12.70 also ! Note that it doesn't happen with the same files on the KDiff3 1.11.5 ! N.B.: Both are executed with through command line with option --config pointing to a .kdiff3rc that doesn't exist in order to avoid any configuration !
4

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.