News for hackers. Stuff that matters.
Re:Difftastic: Syntax-aware structured diff tool by vcmiraldo on Thursday July 08, 2021 @08:46AM (#27771229)
From you description it seems like we're just computing the standard insert-delete tree-edit-distance. These tend to be slow.

This implies that the patch language only supports insertion, deletion and modification of nodes, which is a shame since refactorings, moves and duplications are also common operations in the source-code domain. Additionally, if the patch language only supports insertion, deletion and modification, the merging algorithm will perform poorly.

Re:Difftastic: Syntax-aware structured diff tool by Wilfred on Thursday July 08, 2021 @01:20PM (#27775082)
Yep, that's a fair description. Note that I'm not providing a merge algorithm, just a pretty way of viewing changes.

I did look at modelling moves in an earlier prototype, but it's incredibly hard to display the result in a coherent way when there are also insertions. It was also easier to drop it when I moved to Dijkstra.

As you can see in the screenshot in the readme, it does support inserting tree nodes whilst preserving children, which covers a ton of cases.