Tech Tip: Meld for Visual Diffs
In diff tool speak, a visual diff tool is a GUI application. Meld is such a tool: a tool for displaying differences between files (and directories) and also for merging the differences. Meld is programmed in Python.
Meld can compare two or three files or folders and provides a simple way to merge differences. With just a double click you can copy the differences between the instances.
If you are comparing two directories you can double click on a file to open it and it's corresponding version in the second directory and view their differences. In the directory view you can choose to hide what might be trivial differences, such as binaries and backup files.
Meld also works with several versioning systems, such as CVS, SVN and Mercurial.
| Attachment | Size |
|---|---|
| meld_tip.png | 117.08 KB |










This week 5 lucky Members will receive a copy of The Official Ubuntu Server Book by Benjamin Mako Hill and Linux Journal's very own Kyle Rankin. No entry necessary. Check back here early next week to find out who the lucky Online Members are.




Comments
xxdiff
Let me quote flarg
"I recommend using xxdiff for visual file comparison, and our company uses Perforce, so we need a copy of the p4 binary for Linux"
source: http://www.flarg.com/dell-m60/dell-m60.html
:) xxdiff is good and offers the regretted SGI motif window look
Google for some xxdiff screenshots.
QBzr
Since diffing is closely related to Version Control Systems, I would just like to mention QBzr, which has probably the most impressive diff-visualization I've seen so far. It has the alignment-features of Kompare, with the character-highlighting of Meld, but also adds some simple binaries-additions, mainly it shows images, so you can see if there are radical changes in those.
Highly recommended, if you run BZR (which is also highly recommended).
** meld vs winmerge ** And
** meld vs winmerge **
And what about "WinMerge" (Windows Software)?
If it will hava a Linux version, I think I will prefer it versus meld.
Kompare does not seem an improvement
Kompare seems nicely done, the support for diff files is useful, and it's good that it only does two way diffs, without trying, and failing, to do three way ones, as Meld does.
However, it seems to miss an important feature that Meld and KDiff3 have: intra-line diff, that is, pinpointing what changed *inside* each line, instead of just highlighting flat blocks of lines.
Unless there's a way to do that by specifying a different diff program in the settings, but it's not mentioned in the help.
> it seems to miss an
> it seems to miss an important feature that Meld and KDiff3
> have: intra-line diff, that is, pinpointing what changed
> *inside* each line
That's not true. What changed inside each line is pinpointed using (for example) "bold" letters.
I've checked it now with the latest Kubuntu, but you also can see it in
- http://lukeplant.me.uk/blogmedia/kompare_clipboard_diff.jpeg
- http://www.eloihr.net/linux/img/kompare.png
- http://files.barushev.net/tumblr/images/posts/2008-09/git-kompare.png
- and so on.
If you like
If you like Meld, you'll LOVE Kompare.
Not Me
Apologies, this tip is from Lucas, not from me, I forgot to change the author name when publishing it. Fixed now.
Mitch Frazier is an Associate Editor for Linux Journal and the Web Editor for linuxjournal.com.
Not really three way diff...
Meld is very nice, I use it frequently for moving diff chunks between pairs of files: but it is not really a viable three way diff tool.
One of the common usages of three way diff tools is a three way merge between a common ancestor branch and two diverged successors. In that case, it's vital having diff between all three pairs: A-B, B-C *and* A-C.
Meld gives you only the first two of them; other tools like kdiff3 also show the third one, albeit with a somewhat confusing usage of colors. Not easy doing better on that front though.
meld is great
Meld is truly a wonderful tool! Thanks for the tip.
Post new comment