Default and patience

The EnhancedDiff plugin (GitHub: chrisbra/vim-diff-enhanced, License: Vim) by Christian Brabandt is a plugin for showing diffs with the patience algorithm. You can see this by running git diff --patience, and you might find it useful for cases where the standard diff algorithm fails to match lines after large changes:

Under those circumstances a diff algorithm can occasionally become 'misaligned' in that it matches long sections of curly brackets together, but it winds up correlating the curly brackets of functions in one version with the curly brackets of the next later function in the other version.

This was written by the author of the patience algorithm in a git mailing list post. There's a good Stack Overflow post that explores the patience algorithm, and Christian's readme has screenshots that compare both versions.

blog comments powered by Disqus