Bug 501155

Summary: The resulting file is cleared of all content when saving a resolved conflict
Product: [Applications] kdiff3 Reporter: Chad <camckee>
Component: applicationAssignee: michael <reeves.87>
Status: RESOLVED FIXED    
Severity: critical    
Priority: HI    
Version First Reported In: 1.12.1   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In: 1.12.2
Sentry Crash Report:

Description Chad 2025-03-06 18:33:03 UTC
SUMMARY
When saving a resolved conflict, the resulting file is cleared of all content. This behavior was introduced in version 1.21.1.

STEPS TO REPRODUCE
1. Create a merge conflict within a git repo.
2. Resolve the conflict using content from bother B and C panel allow with a custom modification.
3. Save the resolved content.

OBSERVED RESULT
The file where the conflict occurred is now empty.

EXPECTED RESULT
The resolved conflict content to be saved to the file.

SOFTWARE/OS VERSIONS
Windows: Windows 11 24H2
macOS: 
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: 
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Chad 2025-03-06 18:37:29 UTC
This bug relates to https://bugs.kde.org/show_bug.cgi?id=499331
Comment 2 Chad 2025-03-06 19:09:25 UTC
Additional Information:

The same behavior occurs during the auto resolution of merge conflicts.  All files with conflicts are now empty.
Comment 3 michael 2025-03-06 22:00:24 UTC
I looks its bug intruded by a02232819213714e43b36943e4899ad5b9000c34 reverting in 1.12 as this seems to be quickest way to be sure its fixed there. Will attempt to fix the re-write in master.
Comment 4 michael 2025-03-06 22:02:11 UTC
Git commit 981a7868f524106a0b1586174514b7142fbd9359 by Michael Reeves.
Committed on 06/03/2025 at 22:00.
Pushed by mreeves into branch '1.12'.

Revert "Back port EncodedDataStream re-write."

This reverts commit a02232819213714e43b36943e4899ad5b9000c34.

D  +0    -290  src/EncodedData.h
A  +133  -0    src/EncodedDataStream.h     [License: GPL(v2.0+)]
M  +7    -10   src/MergeEditLine.cpp
M  +1    -2    src/MergeEditLine.h
M  +22   -18   src/SourceData.cpp
M  +68   -37   src/mergeresultwindow.cpp
M  +3    -0    src/mergeresultwindow.h

https://invent.kde.org/sdk/kdiff3/-/commit/981a7868f524106a0b1586174514b7142fbd9359
Comment 5 michael 2025-03-06 22:03:48 UTC
1.12 branch should be fixed now. Leaving this open until master is fixed.
Comment 6 michael 2025-03-22 14:32:07 UTC
Tarballs for 1.12.2 uploaded https://phabricator.kde.org/T17977.  Are you able to build from the 1.12.2 tag to verify this is fixed?
Comment 7 michael 2025-03-22 14:40:32 UTC
Seeing that this is windows. The binaries for kdiff3 are generated at https://invent.kde.org/sdk/kdiff3. And will be uploaded to their release location in the next couple days.

This is the latest build job for windows on 1.12
https://invent.kde.org/sdk/kdiff3/-/jobs/2723440
Comment 8 michael 2025-03-23 21:34:10 UTC
Master should be fixed as well. That branch retains the re-written file data handling.

1.12.2 has been released now.

https://download.kde.org/stable/kdiff3/kdiff3-1.12.2.tar.xz.mirrorlist
Comment 9 michael 2025-04-03 16:51:14 UTC
This should be fixed in master and 1.12.2. That next release will have a warning for encoding errors with a "Don't show again" checkbox.  Such files should be looked over to be sure they have converted correctly.