winmerge icon indicating copy to clipboard operation
winmerge copied to clipboard

Update diffutils

Open Gitoffthelawn opened this issue 4 years ago • 4 comments

Would it make sense to update WinMerge to use a newer version of diffutils?

According to this post, WinMerge is using an old version.

Gitoffthelawn avatar Aug 19 '21 05:08 Gitoffthelawn

I am not sure if it makes sense to upgrade, as I have not been able to figure out what has been improved in the latest diffutils.

Since the license of the latest diffutils is GPLv3, it is incompatible with GPLv2, which WinMerge uses. In order for us to use it, we need to upgrade the license of WinMerge. I have a limited understanding of the license, and since I am not the original author, I don't want to get into too much unnecessary trouble.

Also, the diffutils that WinMerge uses has a lot of WinMerge's own modifications, and I can't simply update the diffutils.

Is there something wrong with the comparison results?

If you're having trouble with the comparison results, WinMerge can now use libxdiff for comparison instead of diffutils, so why not give it a try?

If you select minimal, patience, or histogram as the diff algorithm in the options dialog, libxdiff will be used.

sdottaka avatar Aug 19 '21 11:08 sdottaka

Hi Takashi. Thanks for your reply. I wrote a small book below as a response. It started off as 3 short sentences, and then grew during my stream of consciousness. Enjoy! :)

I am not sure if it makes sense to upgrade, as I have not been able to figure out what has been improved in the latest diffutils.

I do not know either, but often for this sort of library, newer versions feature improved comparison algorithms.

Since the license of the latest diffutils is GPLv3, it is incompatible with GPLv2, which WinMerge uses. In order for us to use it, we need to upgrade the license of WinMerge. I have a limited understanding of the license, and since I am not the original author, I don't want to get into too much unnecessary trouble.

I hear you on that. I'm not an expert on these licenses either. I find they often tend to be time-wasters and a PITA more than anything else. This is a good case of that... they often require additional time and resources when you want to do something as simple as updating an underlying library. I also wish they were much shorter and more clear. They remind me of the Terms and Conditions that everyone just clicks through without actually reading. Few people have the time or expertise to read and understand pages of legalese just to access a website or use a piece of software.

The best license is often the GPL-compatible WTFPL because it's so clear that anyone can understand it. And no one has ever wasted a moment trying to figure it out. It's not appropriate for every project, but it probably is fine for most projects out there. Although devoid of humour, the MIT license is also clear and simple.

I certainly understand your trepidation given that you are not the original author. Maybe he/she can be contacted?

Also, the diffutils that WinMerge uses has a lot of WinMerge's own modifications, and I can't simply update the diffutils.

Ah, that's critical. To me, that seems very important unless it's easy to integrate the changes into a more recent release of diffutils.

Is there something wrong with the comparison results?

Yes. This was actually why I opened this issue report. I love WinMerge and am very, very grateful for it (and to everyone, including you of course, who contributes). Despite my love of the project and all the contributors, I find the actual comparison algorithms to be rather mediocre (at best).

I previously used a closed-source commercial product, but I've tried to move to open-source as much as possible. I do miss the comparison results from that commercial product though! That's why I've tried to be helpful to this project: to try to make WinMerge equal - or better - than the commercial products out there.

WinMerge's ability to find moved sections of text aren't great. Also, when one line has been moved, and a couple other nearby lines have minor changes, WinMerge's results can be, well, mediocre.

I've been creating a few examples to share that illustrate these issues and others like them. It's time-consuming to create such examples because I often can't obtain permission to share the data being compared. So I typically have to manually create new files with nonsense data to replicate the issues. But without context, it can be hard to understand why the WinMerge results aren't as helpful as they could be.

I did find one workaround to some of WinMerge's comparison issues: disabling the "match similar lines" option. Although that sounds like exactly the type of option that would help, I found that disabling it actually improved comparison results quite a bit in a majority of cases.

The other thing I've done is to also have WinMerge2011 at hand. It uses a "less old" version of diffutils. I'm not sure if it's because of that, or because of other enhancements, but I sometimes have found it to produce better results than the "official" WinMerge.

If you're having trouble with the comparison results, WinMerge can now use libxdiff for comparison instead of diffutils, so why not give it a try? If you select minimal, patience, or histogram as the diff algorithm in the options dialog, libxdiff will be used.

Thanks! I did not know WinMerge actually uses a different comparison library for those algorithms. I have experimented with them just a few times, but the results seemed similar. Because I didn't really understand that option, I chose to revert it to the default. Based on your helpful comment, I'm going to experiment with those algorithms many more times. Thank you for the tip! :)

Gitoffthelawn avatar Aug 20 '21 10:08 Gitoffthelawn

It is too bad that there isn't a way to switch between the custom built-in diffutils and the new version, however I can see that the licensing would be a hinderance to that. I hope someone else can chime in to explain the licensing differences. (I so wish I could add colour or font size to make part of a response stand out!)

I can also see that it may be likely that some of the customizations are needed to actually interface with WinMerge, which would make it difficult to provide a way to use the newer library.

mdell-seradex avatar Oct 28 '21 00:10 mdell-seradex

(new) diff (used on command line) with -Br doesn't list difference in blank line at EOF as a difference. Winmerge does. minimal, patience, or histogram also did. Directory compare. This blocks me from identifying the files that really changed, so it's pretty blocking in this use case.

blommaep avatar Aug 25 '22 19:08 blommaep