3

What is `git diff --patience` for? explains how patience diff may be better than myers (the default one).

Is there any reason against using it as a default?

name hints that it may be noticeably slower, speed issues are also mentioned in Examples of different results produced by the standard (Myers), minimal, patience and histogram diff algorithms But running time never was an issue for me - is it a real problem with massive files or other pathological situations?

patience algorithm also has poor result for some cases (like https://gist.github.com/roryokane/79b8ebcb3813ebd934c4) but at least in my experience it is better on typical source code diff (cases like https://gist.github.com/roryokane/6f9061d3a60c1ba41237) - though it is entirely my own observation, so most of noticed result may be a placebo.

Community
  • 1
  • 1
reducing activity
  • 1,645
  • 1
  • 24
  • 50
  • 1
    So take your own constructions out of the equation and take a diff for major version updates in large commonly used repos? For GCC 4.9 -> 5.1 and for Linux 4.2 -> 4.3, the patience algorithm takes a little bit longer but produces a smaller diff than the default algorithm. Which doesn't answer your question, only reinforces your reason for asking it in the first place. :) –  Jan 16 '16 at 15:59
  • There is no way to concisely answer this question because both algorithms have problems with some kinds of inputs with specific patterns, as you've yourself noted. In other words, you would use patience diff when the default doesn't provide good result and patience diff does. If the default algorithm works well enough in most of the cases and the non-default algorithm is slower to execute but works better in some cases, that would be my guess as to why the default is the way it is. – Lasse V. Karlsen Jan 16 '16 at 21:14
  • Well, that is also good answer for me - I hoped that maybe either one is clearly superior. – reducing activity Jan 17 '16 at 17:10

0 Answers0