Changes to libdiff2 regarding apply/unapply diff.

Kevin Kofler kevin.kofler at chello.at
Sun Jan 30 17:59:31 CET 2011


Hi,

On Sunday 30 January 2011, Dmitry Risenberg wrote:
> I am working on KDevelop interactive patch highlighting, and I need to
> introduce some changes to libdiff2. The most important one is changing
> differences location whenever a difference is applied/unapplied. For
> example, when a difference is unapplied, all the following differences
> have their destinationLineNumber updated, as if this particular
> difference has never existed. Currently libdiff2 doesn't do anything
> like this - apply/unapply only changes a flag in the difference. I
> want to know whether such change may break anything, because I haven't
> found any tests for libdiff2 and don't know the kompare code to judge
> from it.

Well, maybe Otto Bruggeman or Jeff Snyder (who still read this list 
occasionally) can answer this. Personally, I must admit that I'm not all that 
familiar with the code.

One thing I can suggest is to try to change the code and then test Kompare and 
see what breaks. (Especially applying differences and saving the result needs 
to be tested.) I do suspect that Kompare might need code changes to support 
this.

A safer way to support this might be to add a separate 
updatedDestinationLineNumber which gets updated, whereas destinationLineNumber 
stays unchanged.

        Kevin Kofler


More information about the Kompare-devel mailing list