There are indeed different diff algorithms. (And there are many possible diffs that will result in exactly the same change to a file - this is one of the reasons it's so sensible that git doesn't store changes, it only stores the state of the tree at each commit :))
Even within git, for some commands you can choose between two different diff algorithms - for example, try moving a function in some C code and compare the output of:
git diff
... and:
git diff --patience
The latter is usually more readable, albeit slower to calculate.
I'm not sure what algorithm opendiff uses, but perhaps it's similar to patience diff?
Unfortunately, I don't believe that it is currently possible in git to use a different diff algorithm in git add -p
, although I would find that very useful too. There is a patch series here to add that feature, but it seems as if the author hasn't sent that upstream yet.