Diffuse - compare/merge text files

Moderator: Forum moderators

Post Reply
User avatar
MochiMoppel
Posts: 1139
Joined: Mon Jun 15, 2020 6:25 am
Location: Japan
Has thanked: 18 times
Been thanked: 373 times

Diffuse - compare/merge text files

Post by MochiMoppel »

BW64 includes 2 GUI utilities to compare text file: Diffuse and PeasyDiff. A third utility would be Xdelta to produce .delta files, but that wouldn't allow visual comparisons.

Personally I find Diffuse much more intuitive, besides its ability to edit and merge the compared files.

Nevertheless a couple of issues make Diffuse unnecessarily difficult to use:

  • The .desktop file contains the line Exec=diffuse -s. The -s option prevents the side-by-side comparison of 2 files when files are selected with Shift+Rightclick in ROX-Filer. Fixed by removing the -s parameter

  • The .desktop file also specifies supported MIME types with MimeType=text/plain;text/x-csrc;text/x-chdr;
    Good for C programmers, but it ignores many other text files. For example it prevents the comparison of shell scripts. I suggest that at least shell scripts, Perl scripts and XML files (for JWM config file) be included: MimeType=text/x-shellscript;text/xml;text/x-perl;text/plain;text/x-csrc;text/x-chdr;. Probably some other types are also useful, but for my needs that would be enough.

  • The Help button leads to a dead page (404 File not found)

  • When using the Xfe file manager (included in BW64), file comparison with F8 key in principle would work even without changes to the .desktop file, however this requires to change the "Fil;e comparator" in Preferences > Programs from beediff (a program not installed in BW64) to diffuse

Alternative way to run Diffuse
ROX-Filer provides an easy and alternative way to load 2 (or more) text files regardless of their MIME and without relying on the .desktop file.
1) Select the 2 files in ROX-Filer
2) Type Shift+! . This will open a command box with a cursor in front of "$@" place holder
3) Add diffuse, so that the command reads diffuse "$@"
4) Press Enter. This will run diffuse with the 2 files side-by-side

EDIT: I don't know why 2 .desktop files for Xdelta exist. The file Xdelta-difference-manager.desktop seems to be the "real" one while xdelta_gui.desktop is a stripped down version of the latter.
I also wonder if the "Document" category would be better suited for text file comparison tools than the current "Utility" category. At least that's were I first looked for them.

diffuse.png
diffuse.png (124.07 KiB) Viewed 259 times
peasydiff.png
peasydiff.png (63.58 KiB) Viewed 259 times
Last edited by MochiMoppel on Tue Mar 05, 2024 9:14 am, edited 1 time in total.
User avatar
BarryK
Posts: 2318
Joined: Tue Dec 24, 2019 1:04 pm
Has thanked: 99 times
Been thanked: 585 times

Re: Diffuse - compare/merge text files

Post by BarryK »

Thanks for that info about Diffuse!

EasyOS currently has 'xfdiff', which is a gtk2 C program. It works OK, except has a limit on line length and lines longer than that cause trouble. Don't recall what that limit is, but hit it several times over the years.

So I might move over to Diffuse.

Just for the record, the source code for xfdiff is here:

https://distro.ibiblio.org/easyos/source/oe/dunfell/

This is my recipe in OpenEmbedded to compile it. It needs a patch for aarch64:

https://github.com/bkauler/oe-qky-kirks ... rky/xfdiff

radky
Posts: 304
Joined: Fri May 28, 2021 2:14 am
Has thanked: 35 times
Been thanked: 268 times

Re: Diffuse - compare/merge text files

Post by radky »

MochiMoppel wrote: Tue Mar 05, 2024 4:04 am

The Help button leads to a dead page (404 File not found)

Yes, for diffuse_0.7.7-1_all.deb in BW64, the online link to the User's Manual points to

https://mightycreak.github.io/diffuse/index.html (which no longer exists)

However, after the release of diffuse_0.7.7-1, the online link changed to

https://mightycreak.github.io/diffuse-old/index.html

This link will be corrected in the next release of BW64.

For now, the following code in a terminal should restore the correct link:

sed -i -e '/WEBSITE/ s/diffuse/diffuse-old/' /usr/share/diffuse/diffuse/constants.py



MochiMoppel wrote: Tue Mar 05, 2024 4:04 am

ROX-Filer provides an easy and alternative way to load 2 (or more) text files regardless of their MIME and without relying on the .desktop file.
1) Select the 2 files in ROX-Filer
2) Type Shift+! . This will open a command box with a cursor in front of "$@" place holder
3) Add diffuse, so that the command reads diffuse "$@"
4) Press Enter. This will run diffuse with the 2 files side-by-side

@MochiMoppel

Thanks for the very useful tutorial.

For comparing two files, the following method also integrates Diffuse with ROX-Filer without MIME-type restrictions:

1 - Launch Diffuse
2 - From ROX-Filer, drag-and-drop files to Diffuse

Post Reply

Return to “BookwormPup”