In git’s defence a perfect diff algorithm seems like a difficult problem to solve in the general case, regardless of VCS… unless any of the next generation VCSes do better then I would take that as a recommendation to check them out!
Yeah it’s probably impossible to get a perfect diff in every case, but that’s irrelevant in the same way that the halting problem is true yet formal verification still exists. We don’t need perfect, we need “good most of the time”.
For example the “slider” problem has existed in Git forever, and apparently there are algorithms that mostly solve it (indent-new), yet Git still doesn’t use them. That repo is 9 years old. I can’t remember what led me to that but I think it was one of the new VCS’s saying they do well on that benchmark (can’t find any reference to it now though).
Pijul should also give better diffs in theory because it actually tracks lines as objects, so it has more information to work with. In the first example in diff-slider-tools it would know the difference between /* and /*. I haven’t actually tried it though.
There are also a few semantic diffing tools that understand syntax that could be integrated - notably Difftastic and Diffsitter.
In git’s defence a perfect diff algorithm seems like a difficult problem to solve in the general case, regardless of VCS… unless any of the next generation VCSes do better then I would take that as a recommendation to check them out!
Yeah it’s probably impossible to get a perfect diff in every case, but that’s irrelevant in the same way that the halting problem is true yet formal verification still exists. We don’t need perfect, we need “good most of the time”.
For example the “slider” problem has existed in Git forever, and apparently there are algorithms that mostly solve it (
indent-new
), yet Git still doesn’t use them. That repo is 9 years old. I can’t remember what led me to that but I think it was one of the new VCS’s saying they do well on that benchmark (can’t find any reference to it now though).Pijul should also give better diffs in theory because it actually tracks lines as objects, so it has more information to work with. In the first example in
diff-slider-tools
it would know the difference between/*
and/*
. I haven’t actually tried it though.There are also a few semantic diffing tools that understand syntax that could be integrated - notably Difftastic and Diffsitter.
Point is, it could easily be better than it is.