-
-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mismatched lines #352
Comments
Could you please show a screenshot of the same compare but without hiding the matched lines (that is without Here line 1 is better matched to line 3 and vice versa but because of line 2 those are separated and cannot be linked. The lines order between files has also changed. You example looks good to me, what do you consider wrong there? BR |
@pnedev I think the extra inserted lines are not correct. I think it should look like this: Thank you for a great plugin! |
Thank you for the feedback. You are right - old Compare plugin and the new ComparePlus plugin use different approaches when finding changed lines. There is no one universal solution and criteria on what is the right outcome (it depends on the text itself) - it is more intuitive for us people and we also have certain expectations. For example look at these screenshots that illustrate the different approaches in another case: For your example ComparePlus gives a "right" result but it kind-of stresses out that lines 10-11 are moved before lines 8-9 (so lines 8-9 and 10-11 have changed places) and are also changed in the beginning - R1, R2 are the diffs and the rest of the lines contents is the match context (sort-of-speak). Compare plugin also gives a "right" result claiming that no lines have changed places (lines order is the same) only the end of the lines are different (cu and op210) and the rest is the match context (sort-of-speak). Which result is better cannot be determined with certainty - it depends on the context and on which difference matters most. Here is an example with your files data but slightly modified: BR |
Hello Pavel, We've discussed this issue before. Allow me to seize the opportunity and bring another example from my recent real-life Compare. Could you please compare these files? Result: I've tried several on-line Compare sites, and most indeed display that section as CP does. I do understand the issue is quite complex, and ComparePlus' approach is certainly much better in many cases. Thank you very much for your ongoing work. Much appreciated. 👍 BR |
Hello my friend Yaron, I appreciate your feedback as always. Great example! 👍 Happy holidays! |
Hello Pavel, I hope you had a good day.
I am very happy! :) I've mentioned it several times before: It's been a few years now, but I have never fully and thoroughly analyzed the best Compare results. I set Could you please look at two more sections? 1. 2. Thank you very much and best wishes. |
Hello again Yaron, Thank you. I will write back if I come with some improvement on this. BR |
Hello Pavel, Whenever you find time to look into it and possibly revise some elements in the current approach, it would be highly appreciated. Analyzing only the few examples in this thread - vs. I do understand the logic and advantage in the first display, but the second one is simpler more easily "grasped". The logic of this smart detection and display is obvious. Again, the logic of this smart detection and display is obvious. Bottom line: Thanks again for your time and hard work. 👍 |
Hi Yaron, Thanks again for the feedback and your thoughts on it, I appreciate it. BR |
Hello Pavel, Whenever you have free time it'll be appreciated.
What "major issues"? :) Allow me a few more points regarding the current issue. I've mentioned the extra-lines/steps as a potential slowing/confusing factor. Another factor is the lines numbers.
The different lines background colors is also a major slowing factor.
👍 |
Hello Yaron,
When such issues appear, that's what I meant ;)
Well, I think that nevertheless that's the right approach. In the specific example given by @thereddestdog both of you are right that it will be better to align the lines and have one group of four changed lines. But more generally (and algorithmically speaking) it is better to find the most appropriate changed lines candidates and that will inevitably separate and displace the corresponding blocks. That way for example if you have a large compared code section that differs and is comprised of totally new code parts (that inevitably has the same semantic language constructs) and a slightly altered existing code part the user will quickly grasp that there is an existing slightly changed part (perhaps a commented section) and a totally new functionality block. Very often the corresponding added/removed blocks pair have different added/removed portion sizes as well.
Are you suggesting to change the colorization so there are no yellow portions but only green/red ones with highlighted and aligned changed portions/lines (just like the Github compare and https://onlinetextcompare.com/) ? Thank you for thinking about how to further optimize and make existing CP functionalities even better and more intuitive. BR |
Hello Pavel,
Much appreciated. :)
I trust and highly respect your judgement. Still, please allow me to ask: are you also referring to the If changing the approach and implementation is complex, I'd certainly understand and respect that too.
Not categorically. I had another case in mind (possibly more complex; please ignore if it is). Even if the You wrote you didn't have free time these days, and here we are engaging in complex discussions. :) Thank you very much once again. 👍 BR |
Hello Yaron,
Its OK, I don't mind discussing how to further improve ComparePlus, it's a pleasure :)
IDC_COL_INITNUM_EDIT is OK as it is now because if we ignore the empty lines the compare context changes and the comparison is as expected.
Yes, I agree. I am not sure though that keeping the background green/red only will be better. Maybe it is worth trying and experimenting with it.
Unfortunately I cannot do much about that. The only possibility would be to provide a way for the user to disable changed lines matching process. Or to use green/red background for changed lines as mentioned above. Thank you for the feedback and sharing your thoughts about change detection implementation. 👍 BR |
Hello Pavel,
Great. It's a pleasure for me as well.
👍
I may not have been clear about that, but I did not suggest it categorically.
That point was not as important. Thank you. 👍 |
Hello Yaron, I have "optimized" compare diffs in the same dev binaries pointed in #353 (comment). For convenience I have pointed to the same dev binaries here: win32, win64 BR |
Hello Pavel, Thank you for this major improvement. Both the I appreciate your time and great work. If you currently don't have time (or energy) for further discussing it, would you mind keeping this issue open? Before the recent changes, the following section was "correctly" aligned even if With the recent commit: Don't you think the first results are better regardless of
Thank you for that too and best of luck. |
Hello Yaron, Thank you.
They are better for sure, you are right. But I need to analyze the compare algorithm thoroughly to check if and how something can be further improved. BR |
Hello Pavel, I know that analyzing the compare algorithm should require a lot of and work. BR |
Lines from one document seem to be matched/compared to lines from another that they shouldn't compared to. That is to say that there are lines which are a far better/closer match. Also sometimes they are matched/compared to lines which are not much of a match, and infact have no equivalent line in the other document.
Perhaps better explained with a screenshot example.
https://images2.imgbox.com/30/7e/3tNRGzNT_o.png
The text was updated successfully, but these errors were encountered: