in reply to Re: wdiff in perl?
in thread wdiff in perl?

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re^3: wdiff in perl?
by Tanktalus (Canon) on Mar 04, 2005 at 15:50 UTC

    In what way is it different from wdiff? I can't see how you can take two files, get the diff, and then apply it to get a third file. You need to start with three files ("base", "branch 1", and "branch 2") to get a fourth ("combined"). What you do is take the diff of branch 1 with base, and apply that diff to branch 2. It's not quite so easy because you'll have to deal with non-obvious matches:

    • Both branches removed the same line. Trivial - keep it removed.
    • Both branches change the same line. If the result is the same, then we're ok, but if they're different, there's no way to tell which one is right.
    • Both branches add a line to the same location - which one goes first often doesn't matter, but often it does.
    I'd look at Algorithm::Diff::Apply to see if that would help.