Bug 441131 - Saving Fails with missing destination
Summary: Saving Fails with missing destination
Status: REPORTED
Alias: None
Product: kompare
Classification: Applications
Component: general (show other bugs)
Version: 4.1.21080
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Kompare developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-18 13:02 UTC by Tim
Modified: 2022-03-13 22:18 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Example (654 bytes, application/zip)
2021-08-18 13:02 UTC, Tim
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tim 2021-08-18 13:02:01 UTC
Created attachment 140818 [details]
Example

SUMMARY
When a file is missing in one folder, while comparing both, saving fails when the file needs to be created.

STEPS TO REPRODUCE
1. Extract the example attachment
2. Compare the folders
3. Apply the diff output, so that "problem.txt" should be created in the other folder
4. Save 

OBSERVED RESULT
It fails to copy the finished file from the tmp directory to the (non existing) destination.

EXPECTED RESULT
It should save.

SOFTWARE/OS VERSIONS
Operating System: Garuda Linux
KDE Plasma Version: 5.22.4
KDE Frameworks Version: 5.85.0
Qt Version: 5.15.2
Kernel Version: 5.13.10-zen1-1-zen (64-bit)
Graphics Platform: X11

ADDITIONAL INFORMATION
This took me so long to figure out; I thought Kompare was really broken...
Comment 1 Kevin Kofler 2021-08-18 13:04:31 UTC
Well, if the file does not exist in one of the folders, diff does the comparison with /dev/null instead. Obviously, you cannot save to /dev/null.
Comment 2 Tim 2021-08-20 09:21:15 UTC
(In reply to Kevin Kofler from comment #1)
> Well, if the file does not exist in one of the folders, diff does the
> comparison with /dev/null instead. Obviously, you cannot save to /dev/null.

I was still hoping, that it would just create the file - I mean the file exists in the tmp directory, but kompare just fails to copy (replace) it into the target folder...
Comment 3 Kevin Kofler 2022-03-13 21:48:22 UTC
Looks like there was some actual breakage in the code here, see the proposed fix at: https://invent.kde.org/sdk/libkomparediff2/-/merge_requests/2
Comment 4 Carl Schwan 2022-03-13 22:18:17 UTC
Git commit f465f1a36fab13087778258e9db9569f112b6818 by Carl Schwan, on behalf of Demitrius Belai.
Committed on 13/03/2022 at 22:18.
Pushed by carlschwan into branch 'master'.

Fix directory creation on destination

When a file not exists on destination directory, Kompare needs to create it. However, Kompare creates a directory instead. 
Related: bug 126870

M  +3    -2    src/komparemodellist.cpp

https://invent.kde.org/sdk/libkomparediff2/commit/f465f1a36fab13087778258e9db9569f112b6818