I just want to take two text files and get side-by-side HTML/colored output of the differences. Is there something simple that works, or do I have Two Problems?
Update: Because you have all failed me, I wrote this.
I just want to take two text files and get side-by-side HTML/colored output of the differences. Is there something simple that works, or do I have Two Problems?
Update: Because you have all failed me, I wrote this.
We had this same problem at work, although we were even worse in that we were looking for a decent PHP version. (Pause for mocking laughter.) As far as I can tell, it's the hardest problem in computer science, and most implementations are garbage.
In my usage, Text::Diff had terribly bad performance for long lines - anything more than about 200 characters in a line and it took forever. If you can break up long lines of HTML, maybe at tag boundaries, things might improve.
The case I'm seeing it fail on is a large text file with short lines and few differences -- and it doesn't fail on this file all the time, only with some particular sets of differences. So basically it just sucks.
Beyond Compare. Amazingly useful as a standard user program, but also has good command-line scriptability that can produce an HTML difference report.
Had a similar issue a while ago, couldn't find anything free that could do this so I used a trial version of Beyond Compare. Its good.
+1 for Beyond Compare.
Just not sure it fits Jamies problem description.
https://metacpan.org/pod/HTML::Differences
I'm drunk please delete.
wdiff can definitely do colors in the terminal, and I think Mediawiki (optionally) uses this for html diffs, but I can't confirm that.
Use Bram Cohen's Patience Diff because it will not drive you insane for the reasons indicated. I don't think it's available in native Perl, but you can get it from git diff --patience --no-index path1 path2
Er, and as to part two for side-by-side colorized HTML, there are several varieties of things called diff2html out there, but perhaps you might be more interested in git diff --color-words with HTML::FromANSI or slightly snazzier with pixelbeat's ansi2html.sh?
There's an ocaml implementation of patdiff that does html output nicely.
I'm using diff_match_patch. Not a perfect fit but works okay.
I use Beyond Compare to compare text files. It works rather well. See http://www.scootersoftware.com/
What's wrong with
diff -y file_before file_after
| pygmentize -l diff -f html -O full -o file_diff.html
(nice discussion of the issue on http://stackoverflow.com/questions/641055/)