Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set patience as default git diff algorithm

Tags:

git

diff

In .git/config I tried:

[diff]     patience = true 

But no luck

Do I have to do:

git diff --patience git show --patience HEAD 

etc., every time?

like image 441
EoghanM Avatar asked Dec 16 '10 11:12

EoghanM


People also ask

What algorithm does git diff use?

Myers. Myers algorithm was developed by Myers (1986). In the git diff command, this algorithm is used as the default. The operation of this algorithm traces the two primary identical sequences recursively with the least edited script.

What is the diff algorithm?

A diff algorithm outputs the set of differences between two inputs. These algorithms are the basis of a number of commonly used developer tools. Yet understanding the inner workings of diff algorithms is rarely necessary to use said tools.


1 Answers

Since Git 1.8.2, Git will use diff.algorithm:

git config --global diff.algorithm patience 

It took a few iterations:

[PATCH v3 0/3] Rework git-diff algorithm selection

[PATCH v2 0/3] Rework git-diff algorithm selection

[PATCH 0/3] Rework git-diff algorithm selection

[PATCH] diff: Introduce diff.algorithm variable.

[PATCH] config: Introduce --patience config variable

like image 128
Tobu Avatar answered Sep 26 '22 02:09

Tobu