You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(First, thank you for this tool, it's very helpful in double-checking that correct fields have been changed! Made my day.)
Given a top-level list, each member of which is an object, when generating a diff the diff is emitted in reverse order. This is contrary to my expectations.
Yeah, that is a little odd. I was iterating backward through lists so that when a diff is adding or removing something from the end of a list, it can still be applied linearly. An important invariant is that the diff can be applied with the patch operation to get the original value. And diffs are always applied one hunk at a time.
I've just finished refactoring the diff format on the master branch to address this and a couple other oddities. In the next version (which will be a major version bump) iteration through lists will forwards and make more sense. I'll also be calculating the minimum common sub-sequence in order to produce a minimum diff. And I'll be able to stitch in a whole series of values instead of adding them each in a separate hunk. I'll post back here when I have a working prototype, in case you're interested in trying it out.
(First, thank you for this tool, it's very helpful in double-checking that correct fields have been changed! Made my day.)
Given a top-level list, each member of which is an object, when generating a diff the diff is emitted in reverse order. This is contrary to my expectations.
Eg, given
old.json
ofand
new.json
of:then at present (jd version 1.7.1), we see:
I would expect the items to be shown in increasing index order, normally.
The text was updated successfully, but these errors were encountered: