Open GoogleCodeExporter opened 8 years ago
I can document the process I used a moment ago when I updated my "improved
github diffs" user script
(https://github.com/johan/github-improved/blob/master/better-diffs.user.js - or
direct install link
https://github.com/johan/github-improved/raw/master/better-diffs.user.js) a
moment ago, which uses Neil's amazing diff backend without the match and patch
parts:
* replace all instances of "diff_match_patch" with "Diff" in javascript/diff_match_patch_uncompressed.js
* remove all the code from // MATCH FUNCTIONS to the end of the file
* wrap the file between a "var Diff = (function(){" and "return new Diff; })()" (without the quotes)
* prepend a little header comment annotating what revision it's based on, and linking to the source here
That's all. (Step 3 is only necessary if you want to keep identifier leakage to
just the Diff object, it's really only the three DIFF_DELETE, DIFF_INSERT and
DIFF_EQUAL constants.)
That said, it would be neat if the three portions were split up into a diff.js,
a match.js and a patch.js (maybe a main.js too?) with a Makefile that
recombines them back together into the current form;
Original comment by oyas...@gmail.com
on 9 Jun 2011 at 12:55
Original issue reported on code.google.com by
philfreo
on 4 May 2011 at 10:01