30

I've hardly ever used anything other than Meld. Can you recommend anything else?

It would be extra nice if you give a reason for your recommendation (as a Comment).

[note] I want an alternative because Meld has recently lost the feature to copy entire contents from one file to another. I'm referring to the functionality available via the Copy To Left/Right right-click menu item.

[update] I just checked, and the problem was introduced by 1.3.2. 1.3.1 works well, and the latest I've checked is 1.4.0, and it doesn't work.

smci
  • 173
tshepang
  • 65,642
  • 4
    Have you tried http://kdiff3.sourceforge.net/? – kasterma Dec 06 '10 at 16:26
  • @kas I just tried now, and I noticed that it doesn't offer what I need from such a tool (check the note I added to the Question). – tshepang Dec 06 '10 at 16:47
  • 2
    @Tshepang: kdiff3 does allow for this. Mark a file "merge from A to B" and then begin the merge. You may choose, difference by difference, which parts to copy. Omit any that you don't want to copy. When satisfied hit Save. To copy the whole file just mark it as "Copy A to B." You may need to reverse A and B, depending on which way you're actually copying. – Sorpigal Dec 06 '10 at 17:09
  • @Sor You sure? I'm using version 0.9.95 and I don't find "merge from A to B". I checked under Merge menu. – tshepang Dec 06 '10 at 17:16
  • @Tshepang: My version is 0.9.86, so perhaps the newer one is slightly different, but that said: If you are looking at the diff of two directories you should have a column called "Operation" from which you can select your merge operation for that file. If you're doing a merge of just two files and not scanning two directories then I don't know how to select the operation, because I never use kdiff3 this way. – Sorpigal Dec 06 '10 at 17:27
  • @Sor I was doing a diff of just 2 files, no wonder I wasn't seeing what you were seeing ;) – tshepang Dec 06 '10 at 17:54
  • It still ought to be possible; consult the kdiff3 handbook. – Sorpigal Dec 06 '10 at 17:55
  • What are the issues you've been having with meld? Might help for a rec. – gabe. Dec 06 '10 at 22:51
  • @gabe There used to be an option which was accessible from right-click menu named Copy file to Left/Right (or something along those lines). I used this feature quite a lot, and I'm too lazy to investigate what happened. – tshepang Dec 07 '10 at 00:02
  • What was the issue that you faced with Meld? – Barun Feb 18 '11 at 18:11
  • @Barun see my updated answer – tshepang Feb 18 '11 at 18:11
  • 1
    @Tshepang I use Meld 1.3.0, which I believe is the latest version. Select the entire contents of the left hand side file (click over the text and press Ctrl+A), then right click over it. I get the the option "Copy to Right", and clicking on it copies entire contents of the left hand side file to right hand side file. Similarly, I get the "Copy to Left" option for the other file. So, it does allow you to copy the entire contents of a file to the other. – Barun Feb 18 '11 at 18:11
  • @Tshepang Touché. News section at http://meld.sourceforge.net/ is outdated! – Barun Feb 18 '11 at 18:11
  • @Barun Check my updated. – tshepang Feb 18 '11 at 18:11

7 Answers7

24

There are a number of tools that are usable:

  • meld
  • kompare -- diff file viewer
  • kdiff3 -- file difference viewer
  • Diffuse -- file difference viewer

Do you have two files and want to view their differences? Use a "file difference viewer". Do you have a diff file and want to look at it in an easy-to-read display? Use a "diff file viewer".

Johan
  • 4,583
  • +1 for suggesting Kompare; It seems better than the Kdiff3, at least for my use. – tshepang Dec 06 '10 at 19:40
  • 1
    there is also diffuse: http://diffuse.sourceforge.net/manual.html – gabe. Dec 06 '10 at 22:52
  • @gabe Added that lovely tool to the list. – tshepang Dec 07 '10 at 00:18
  • diffuse do have some nice svn knowledge out of the box, so you can more or less use it like "svn diff". – Johan Dec 07 '10 at 07:39
  • found another one: http://furius.ca/xxdiff/ – gabe. Dec 12 '10 at 00:22
  • 1
    @Tshepang - I love that kdiff3 will highlight individual characters that have changed in a line. Most diff tools will just highlight the whole line, which can make it more difficult to figure out what changed. Just one nice feature to keep in mind... – Justin Ethier Feb 18 '11 at 14:12
  • Some of these seem to only want to open the pairs of original files, or directories, and do not take the results of a diff. – einpoklum Jan 25 '16 at 16:49
9

There is also vimdiff (with its GUI version gvimdiff).

Michael Mrozek
  • 93,103
  • 40
  • 240
  • 233
Johan
  • 4,583
7

Emacs' bundled ediff package is a pretty good diff viewer (start with the commands in Emacs' Tools / Compare and Tools / Merge menus). It has all the basic features (highlight the differences between two files, jump between differing blocks) and most common intermediate features (compare portions of files, compare revisions grabbed from version control, compare directory trees, use a common ancestor as a reference point, produce a merged version). It doesn't have very fancy ignore capabilities, however.

What Emacs has over most other diff viewers includes better search capabilities, syntax highlighting, Lisp extensibility. Oh, and an integrated editor.

SamB
  • 440
  • When I tried the emacs diff viewer I found that the buffers didn't scroll at the same time (in vimdiff they scroll so the related parts are next to one another all the time). Do you know you to achieve this in emacs? – kasterma Dec 06 '10 at 22:43
  • @kasterma: v/^ (ediff-scroll-vertically, going up or down depending on the key you press to invoke it) scrolls all the windows in parallel. – Gilles 'SO- stop being evil' Dec 06 '10 at 22:47
2

I have used tkdiff (http://sourceforge.net/projects/tkdiff/) for years. It does what I want as far as displaying differences between files, and it's able to write out a "merge" file with any ol' selection of left and right file difference selections.

Drawback: it's written in Tcl/Tk, and not all systems have that.

SamB
  • 440
2

I recommend kdiff3. It can be used both by programmers to compare src files during software development or by people doing periodic backup to compare 2 folders (recursively all the way down), the first one in your system hard disk and the second one external backup hard hard disk.

In the later case you can configure for a date and time and size comparison as opposed to line by line comparison needed by programmers. It comes up with a nice colour coded output for each dir/file involved in the comparison and you can selectively add/remove the new files you have created/deleted in your system hard disk to the backup hard disk.

1

I think xxdiff does what you want.

wazoox
  • 1,364
0

A comparison of various diff utils. Old but still valid.

http://web.archive.org/web/20111003125309/http://amjith.blogspot.com/2007/07/visual-diff-tools-in-linux.html

SamB
  • 440
Amjith
  • 373