61

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?

2 Answers 2

108

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

Sign up to request clarification or add additional context in comments.

2 Comments

Seems that it's now in standard (well, I'm on git version 1.8.2.1)
It seems like histogram is a better option now. See stackoverflow.com/a/32367597/2019549.
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]

4 Comments

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.
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.
@EoghanM Might be appropriate at this point to change the accepted answer.
So first, OP asked how to set the default diff, so you're not answering the question at all. And secondly, "in lieu of a config-based answer", you give... a config based answer...

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.