git diff algorithm that does not rip functions apart? (language-aware diff)
问题 Is it possible to configure git diff to respect indentation and syntax? I am not talking about ignoring indentation and spaces, but rather to use blank lines, indentation levels and possibly brackets, to help matching the old lines to new lines. E.g. git diff often cuts through functions and their docblock, like this: class C { /** + * Goes to the bar. + */ + function bar() { + return 'bar'; + } + + /** * Gets your foo up to date. */ function foo() { When I would prefer class C { + + /** + *