Summary: | Compare with Active Document giving incorrect result. | ||
---|---|---|---|
Product: | [Applications] kate | Reporter: | Richard <riander73> |
Component: | application | Assignee: | KWrite Developers <kwrite-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | christoph, waqar.17a |
Priority: | NOR | ||
Version First Reported In: | 25.04.1 | ||
Target Milestone: | --- | ||
Platform: | Microsoft Windows | ||
OS: | Microsoft Windows | ||
Latest Commit: | https://invent.kde.org/utilities/kate/-/commit/5fabc697b02cc2cf78642b35d8eb441f6340daa2 | Version Fixed In: | |
Sentry Crash Report: | |||
Attachments: | Screenshot of an example comparison with obvious incorrect result. |
I assume that happens if we find no tool to do the diff, but that should be better reported. (In reply to Christoph Cullmann from comment #1) > I assume that happens if we find no tool to do the diff, but that should be > better reported. It's true that I do not have any of the kdiff3, kompare, or melt installed or in my PATH. But they are all greyed out in Kate and can't be selected. But the built-in compare is not greyed out and should still work? If I am not wrong we call 'git diff' for that. We have no own diff algo implemented. Yeah, we use git to get the diff. Can you paste the output of following command: git diff --no-color --no-index test2334.txt "test2334 - Copy.txt" And if possible, please share the files in question. changing status to needsinfo. ๐๐งน โ ๏ธ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME. For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging. Thank you for helping us make KDE software even better for everyone! I think I found the source of the error. When the file have CR LF as line break, then the compare function works. But when the files have only LF (unix) line breaks, then it does not work. I made new smaller files for testing "test_1LF.txt" > Test > Test 4 > 123 "test_2LF.txt" > Test > Test 2 > 124 Output from "git diff --no-color --no-index test_1LF.txt test_2LF.txt" > warning: in the working copy of 'test_1LF.txt', LF will be replaced by CRLF the next time Git touches it > warning: in the working copy of 'test_2LF.txt', LF will be replaced by CRLF the next time Git touches it > diff --git a/test_1LF.txt b/test_2LF.txt > index a4ba04d..769dafb 100644 > --- a/test_1LF.txt > +++ b/test_2LF.txt > @@ -1,3 +1,3 @@ > Test > -Test 4 > -123 > \ No newline at end of file > +Test 2 > +124 > \ No newline at end of file The exact same files with CRLR formatting gives the same output, but without the 2 warnings in the beginning. Perhaps the warning output somehow prevents Kate from displaying the output properly? > Perhaps the warning output somehow prevents Kate from displaying the output properly?
That could be true. I will check and fix soon
Git commit dab369b40482f41280c0a5f28fd718a36fe75ce7 by Waqar Ahmed. Committed on 27/08/2025 at 18:33. Pushed by waqar into branch 'master'. diff: fix output being ignored if there is an error/warning M +3 -1 apps/lib/diff/diffwidget.cpp https://invent.kde.org/utilities/kate/-/commit/dab369b40482f41280c0a5f28fd718a36fe75ce7 Git commit 5fabc697b02cc2cf78642b35d8eb441f6340daa2 by Waqar Ahmed. Committed on 27/08/2025 at 18:36. Pushed by waqar into branch 'release/25.08'. diff: fix output being ignored if there is an error/warning (cherry picked from commit dab369b40482f41280c0a5f28fd718a36fe75ce7) Co-authored-by: Waqar Ahmed <waqar.17a@gmail.com> M +3 -1 apps/lib/diff/diffwidget.cpp https://invent.kde.org/utilities/kate/-/commit/5fabc697b02cc2cf78642b35d8eb441f6340daa2 |
Created attachment 183791 [details] Screenshot of an example comparison with obvious incorrect result. SUMMARY Comparing 2 files on Windows does not work. Even worse, it does not give an error or indication that something is wrong, it simply states "No differences found" despite there being many differences between the files. STEPS TO REPRODUCE 1. Open two files 2. Select "Compare with Active Document" on the second file when the first file is being viewed. OBSERVED RESULT "No differences found" EXPECTED RESULT List of differences with color coding. SOFTWARE/OS VERSIONS Windows: 25.04.1 from the Microsoft Store. ADDITIONAL INFORMATION The bug also exist on the latest nightly 24.11 version as well.