Expose the Minimal diff algorithm#1227
Conversation
|
@tomcsmith1990 Neat! One nitpick though. Would you mind melding those two commits together into an atomic/cohesive one?
Duh. If I remember correctly I also searched for a simple example, in vain. @peff Would you know more about this? |
|
Fix #1057 |
|
When in doubt, throw CPU at the problem: This comes up with lots of examples in the translation files, which are quite hard to read (for instance, git/git@82aa9b7). We can try it restricted only to So no, I guess I don't really have any good examples. |
|
@peff ❤️ for this amazing answer! |
1dd11be to
6e6d08d
Compare
|
@nulltoken thanks, I've squashed the commits down into one. |
6e6d08d to
6cad2ee
Compare
Expose the Minimal diff algorithm
|
💥 Cheers! |
This adds the
Minimaldiff algorithm and uses it if specified when doing a diff, fixing #1057.Unfortunately it's difficult to find an example which produces a different diff output for the
MeyersandMinimalalgorithm, so I don't have a unit test to check 1dd11be. It looks like the libgit code suffered the same problem and only test that output from patience differs from the default, which is already checked inUsingPatienceAlgorithmCompareOptionProducesPatienceDiff.The change could be tested by extracting a class from
Diff.BuildOptionsand checking that theGitDiffOptionsreturned have the correct flags set, but that does break the encapsulation slightly. I'm happy to make that change if you want though.