41

I have a patch file (unified diff), like the output from svn diff, git diff, or diff -u .... I want to review it, but the unified diff format - especially with many files & changes - is hard on my eyes.

How can I get a nicely-formatted diff view from the patch file? I don't have the files themselves, only the diff, so I can't use all the regular diff tools.

So far my 2 best tactics are:

  1. Load the diff in gvim and get some syntax highlighting
  2. Paste the diff into a Trac wiki in a #!diff-formatted section and click "preview" - this creates an awesome diff view:
{{{
#!diff
<unified diff here>
}}}

Are there desktop tools that can do this? Is there a way to persuade kdiff3 / diffmerge / p4merge / etc. to visualize the patch file? Something that replicates Trac's visualization would be great as well.

EDIT: bonus points for Windows support as well, preferably with an installer or a pain-free installation.

orip
  • 73,323
  • 21
  • 116
  • 148

3 Answers3

28

Try using kompare - http://www.caffeinated.me.uk/kompare/. It should do the job.

EDIT: Also, check out the list of file comparison tools here: http://en.wikipedia.org/wiki/Comparison_of_file_comparison_tools - have a look at the column "Patch preview" in one of the tables.

pako
  • 1,908
  • 4
  • 24
  • 40
  • 1
    +1 Awesome, thanks! As a Windows user I'd prefer a standalone download though :( – orip Feb 25 '10 at 22:04
  • There's supposed to be a standalone installer here: , but when I checked this morning, there's a ReferenceError coming up when you try to use it :( – Remi Despres-Smyth Oct 04 '19 at 12:10
5

Not a Windows solution, but if you're on Mac OS X, PatchViewer (http://appledeveloper.com.au/products/patchviewer/) will do what you're after.

(Disclaimer: I am the author of PatchViewer.)

user2067021
  • 4,399
  • 37
  • 44
  • [spoke too soon](https://stackoverflow.com/questions/2895005/tortoisesvn-good-patch-file-viewer/14846390#comment80055012_14846390) :^D – ruffin Oct 03 '17 at 17:39
5

Have a look at idiff

pixelbeat
  • 30,615
  • 9
  • 51
  • 60
  • Thanks, cool script! I currently get the same effect from piping into VIM (cross-platform too, good for Windows), except the ability to keep piping. – orip May 11 '10 at 16:40