I'm reviewing my peer's code. I use SourceGear DiffMerge as my diff program, on a Windows environment.

While I'm using the diff program, I can clearly see the code changes, etc.

Is it possible to save the diff display somehow, with all its colorful rendering and strike-throughs so that I can send my comments by mail?

In other words, is it possible to export the diff display to a single file (which includes all the relevant data) to be displayed without the actual need to save the two files separately? (Perhaps HTML is fit for this job).

Can you recommend on a diff program that can export the diff as a single file?

Thanks in advance!

  • 1
    Why not just send the diff file? It contains exactly the changes made and can be viewed with most programmers text editors with color etc. Or do you want to make a screenshot?? – Benjamin Bannier Oct 25 '11 at 16:06
  • 1
    That depends on the program you are using. No general solution would apply. If the program has no way to save the diff report, record the diff as a movie. – NoChance Oct 25 '11 at 16:10
  • 1
    diff -u fileold filenew > patch.patch – Lazy Badger Oct 26 '11 at 3:39
  • Developer tools are off-topic here: you'd want to check Stack Overflow instead. – user8 Oct 26 '11 at 13:18

WinMerge can diff compare any file(s) or folder(s) and generate a report (Tools > Generate Report) of differences in various formats (including HTML and CSV).

You can generate a report add your own comments into the results. Run the report at the file level to get a colored diff compare.

Ultimately, the best method does depend on your tools (which you did not specify). TFS has some powerful diff tools. TFS is also highly extensible, lots of plugins you can download.

  • Winmerge in common is one of the weakest differs-mergers in Windows-world (IMNSHO) – Lazy Badger Oct 26 '11 at 3:41

Common practice in UNIX-land is to just send the plain diff output. The recipient can then use a tool of their choice to read it.

  • Windows environment, I updated my question. – Ron Klein Oct 25 '11 at 18:41
  • Still applies. I merely mentioned UNIX because that's where diff originally comes from, and because diffs are ubiquitous in UNIX-land. Best practices from the home of diff should also make sense on other platforms. – tdammers Oct 25 '11 at 18:45

TortoiseMerge from TortoiseSVN can export result of files-compare to *.diff (if you don't want to use old good ported to Win diff -u)

TortoiseUDiff (from the same source) show this colored-diff (sorry for non-readable text - it's UTF8 without BOM, don't know how to visualize it in TortoiseUDiff correctly: never use this feature): red is deleted strings, green - added, white - context

enter image description here


Whenever I want to save diff results to a file, I use sdiff Unix/Linux/Cygwin utility. No color but still human readable.

  • Windows environment, I updated my question. – Ron Klein Oct 25 '11 at 18:41
  • @RonKlein Hence Unix/Linux/Cygwin. Cygwin applies to Windows. – Dan Jul 18 '16 at 14:37

Not the answer you're looking for? Browse other questions tagged or ask your own question.