问题
Is there a diff tool that allows saving of the compare markup?
To clarify, I would like to save the actual comparison of the two files that shows the differences to send to someone for review.
EDIT
Lots of good answers here. In my case I already had a copy of Beyond Compare but didn't see the option. Thanks to John Saunders for pointing out the feature. It's "Session...Text Compare Report..." BTW.
My question was not specifically about Beyond Compare, so I am going to accept the answer that currently has the most up votes.
回答1:
WinMerge is free and allows you to save the differences in various formats. It works well enough for me to not bother looking elsewhere, and I like the price.
There is also a portable version if you can't, or don't want to, install it.
回答2:
You can do this with the command line diff if you're using Unix, though it sounds like you're not. Cygwin does bring a CLI diff, and Mac OS X ships with it.
$ diff <file> <other file> > mydiff.txt
回答3:
Beyond Compare does this.
回答4:
I use the Scintilla Text Editor (SciTE) to open a diff file generated by command line or WinMerge, and then export the RTF, and it preserves color highlighting of differences. I use this method especially when emailing short patches for review in-house, and I use Outlook, for example.
The process I used just now as an example:
# diff -U 1000 a.txt b.txt > diff.txt
# scite diff.txt
### Edit-Copy as RTF
### Paste into Outlook
http://imagebin.ca/img/nBG25am.png
WinMerge provides this functionality through the Tools->Generate Patch menu item. I use the MSYS tools on windows, so that I run GNU diff a lot, but once you get the output, I would use SciTE if you need something like the above.
回答5:
ExamDiff does a comparison which is shown in a window. It can save a Unix-like formatted version of the differences. Also, the file-to-file comparison version of the program is free!
来源:https://stackoverflow.com/questions/1109929/diff-tool-that-allows-saving-the-compare-markup