Bram Cohen (bramcohen) wrote,
Bram Cohen

The diff problem has been solved

Those of you who have used version control systems for a long time, or anything which has to diff extensively for that matter, know that once in a while they completely bungle a diff and give output which is, to put it charitably, extremely confusing.

Coming up with an algorithm which reliably gives good diffs is far from trivial, but is a problem which has now thankfully been solved. If you get the latest version of bazaar and use its diff utility it will give reasonable diff output on almost anything. All other version control systems (and I mean all others) should switch to using bazaar's diff algorithm as a swap-in replacement, a change which has essentially no downside. (It also has better asymptotic runtime, and code which is easier to understand and debug.)

Full disclosure: I came up with this diff algorithm, and bazaar uses my code :-) There's some discussion on the bazaar mailing list archives about interesting behavioral tweaks, but they don't appear to have been applied in the current release.

Update: My explanation of how patience diff works and why is here

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded