The Myers diff algorithm that is used in Git (2017)
blog.jcoglan.com
blog.jcoglan.com
https://gist.github.com/roryokane/6f9061d3a60c1ba41237
Those alternative algorithms can be requested with command line flags like "git diff --histogram" or "git diff --patience". The default algorithm can also be changed via the git config file.
I reckon it'd be nice to include which to use in the commit too.
From those two examples only, looks like fewer hunks are better, but so are smaller hunks, at least when the number of hunks are equal.
Similarly, one could imagine a language-specific regexp that gives "anchor points" such as declaration start, where one would prefer that a single diff hunk doesn't mutate things across that anchor, if it doesn't have to.
OP's blog has another series of posts about patience diff. They are also an interesting read: https://blog.jcoglan.com/2017/09/19/the-patience-diff-algori...
[merge]
conflictStyle = diff3for a Rust diff library crates, see https://github.com/changeutils
https://leetcode.com/problems/edit-distance/
graph search + dynamic programming to pass the phone screen.
Ofcourse the consideration here just the smallest number of edits.