Examples of different results produced by the standard (Myers), minimal, patience and histogram diff algorithms

Petr picture Petr · Nov 13, 2013 · Viewed 9.4k times · Source

Git offers these 4 diff algorithms, but without any further information what are their differences.

What are the advantages of each of this algorithms? Is there some comparison of various cases where the algorithms perform differently?

Answer

jelle foks picture jelle foks · Nov 25, 2013

I think there are multiple algorithms supported because none of the algorithms are clearly the best choice in all cases.

The differences are in readability of the patch output and processing time needed to generate the patch.

Summarizing, this is what I understand the differences are:

Here is a comparison of speed for Myers, patience, and histogram: http://marc.info/?l=git&m=133103975225142&w=2

Here is a comparison of diff output of Histogram vs Myers: http://marc.info/?l=git&m=138023003519837&w=2