A visual patch tool for Linux

Eugene Kirpichov picture Eugene Kirpichov · Dec 10, 2009 · Viewed 24.6k times · Source

I've got a file and a patch for it. I'd like to visually apply the patch, t.i. see how the changes proposed by the patch look in context, make some corrections, and save the resulting file.

What tool can do that?

Neither of the visual diff tools (i.e. meld, diffuse, diffmerge) do what I want: they don't work with patches, they merely merge whole files.

Answer

initzero picture initzero · Feb 3, 2011

I really like Kompare. It is just a (very nice) graphical interface for diff.

http://www.caffeinated.me.uk/kompare/

sudo apt-get install kompare

Creating and applying patches

Kompare is able to create a patch file which lists only the differences between two compared text files A and B. Further, Kompare can apply a patch file which was created this way to an original file A and, in this manner, recompute the contents of the corresponding file B. This is a comfortable utility for passing a corrected version of a file to a friend who already has an older version of the same file, because only the (relatively small) patch file has to be delivered and the receiver can generate the corrected file by applying the patch to the original file.

The patches created and applied by Kompare are compatible to patch files generated or applied by the command line interface diff utility, because Kompare is in fact merely a graphical front end to diff and the patches are created and applied by patch, which gets called by Kompare.