gitcmd: Pass in configs to enable custom diff algorithms
Pass in a set of configs that is of the form
[diff "<name>"]
algorithm = <name>
This allows adding the following to .gitattributes to set diff algorithms based on a path:
*.json diff=<name>
meyers, patience, histogram, minimal can be used as
This utilizes the ability in Git to set the internal diff algorithm
To test
In order to test, add a file with before and after contents with the following:
before:
unique line 1
common
common
common
unique line 2
common
common
common
unique line 3
after:
unique line 3
common
common
common
unique line 1
common
common
common
unique line 2
In your GDK, add a .gitattributes file in the default branch:
*.txt diff=histogram
*.txt diff=myers
When you navigate to the MR diffs, the diffs should appear different.
fixes: #2591
Edited by John Cai