Diff for Javascript, revisited
Last weekend I finally revisited the diff-in-javascript code I’d written a couple of years back, adding (very simple) patch-like and diff3-like functionality.
On the way, not only did I discover Khanna, Kunal and Pierce’s excellent paper “A Formal Investigation of Diff3“, but I found revctrl.org, the revision-control wiki, which I’m just starting to get my teeth into. I’m looking forward to learning more about merge algorithms.
The code I wrote last weekend is available: just download diff.js. The tools included:
Diff.diff_comm- works like a simple Unix comm(1)Diff.diff_patch- works like a simple Unix diff(1)Diff.patch- works like a (very) simple Unix patch(1) (it’s not a patch on Wall’s patch)Diff.diff3_merge- works like a couple of the variations on GNU’s diff3(1)
Read on for some examples showing the library in action.
Continue Reading 2 comments May 9th, 2008 tonyg