55

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?

EoghanM
  • 20,021
  • 21
  • 80
  • 110

2 Answers2

99

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

Community
  • 1
  • 1
Tobu
  • 23,001
  • 3
  • 85
  • 97
7

In lieu of a config-based answer, you could set an alias in your .gitconfig like so:

[alias]
dp = diff --patience

Which will allow you to do git dp [optional refspec]

urschrei
  • 21,261
  • 12
  • 36
  • 75
  • 1
    Thanks! not ideal though as I have to the same for `show` and maybe a few more commands - and then try and train myself to use the new versions. – EoghanM Dec 16 '10 at 14:25
  • Not to mention `merge`, `rebase`, etc.—the real reason I wanted to set patience diff by default. I'm pretty certain I won't mind if it takes a bit longer but I don't have as many @!#$#@ conflicts. – Luke Maurer Feb 26 '14 at 20:37
  • @EoghanM Might be appropriate at this point to change the accepted answer. – Arya McCarthy Jun 28 '17 at 20:43