# Feature Request: Add diff.word-diff <mode> and perhaps diff.word-diff-regex <regex> configuration options to enable always using word-diffs in git diff

3 messages from 2018-04-14 to 2018-04-15. Participants: Doron Behar, Ævar Arnfjörð Bjarmason, Junio C Hamano.
Thread: https://gitlist.dev/t/48287

## Doron Behar, 2018-04-14 20:02

Subject: Feature Request: Add diff.word-diff <mode> and perhaps diff.word-diff-regex <regex> configuration options to enable always using word-diffs in git diff
Message-ID: <20180414200227.b35bdkir6ygio5is@NUC.doronbehar.com>
URL: https://gitlist.dev/e/20180414200227.b35bdkir6ygio5is%40NUC.doronbehar.com

```
I've just came across the wonderful command line option for `git diff`:
`--word-diff`. It could be great to have a configuration option that
will enable this feature by default when running `git diff`.

```

## Ævar Arnfjörð Bjarmason, 2018-04-14 20:07

Subject: Re: Feature Request: Add diff.word-diff <mode> and perhaps diff.word-diff-regex <regex> configuration options to enable always using word-diffs in git diff
Message-ID: <87604tft6p.fsf@evledraar.gmail.com>
URL: https://gitlist.dev/e/87604tft6p.fsf%40evledraar.gmail.com
In-Reply-To: <20180414200227.b35bdkir6ygio5is@NUC.doronbehar.com>

```

On Sat, Apr 14 2018, Doron Behar wrote:

> I've just came across the wonderful command line option for `git diff`:
> `--word-diff`. It could be great to have a configuration option that
> will enable this feature by default when running `git diff`.

Do you know you can do:

    git config --global alias.wdiff "diff --word-diff"

?

```

## Junio C Hamano, 2018-04-15 21:13

Subject: Re: Feature Request: Add diff.word-diff <mode> and perhaps diff.word-diff-regex <regex> configuration options to enable always using word-diffs in git diff
Message-ID: <xmqqbmek18bz.fsf@gitster-ct.c.googlers.com>
URL: https://gitlist.dev/e/xmqqbmek18bz.fsf%40gitster-ct.c.googlers.com
In-Reply-To: <87604tft6p.fsf@evledraar.gmail.com>

```
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:

> On Sat, Apr 14 2018, Doron Behar wrote:
>
>> I've just came across the wonderful command line option for `git diff`:
>> `--word-diff`. It could be great to have a configuration option that
>> will enable this feature by default when running `git diff`.
>
> Do you know you can do:
>
>     git config --global alias.wdiff "diff --word-diff"

Correct, but it is a "you could instead do it this way" that is not
accompanied by a "you do not want to do what you said you want to
because.." answer.  Having the latter is often helpful to learn why
the suggestion is actually not a mere "you could" but is a "you are
better off doing it this way".

Even though it is discouraged, people script using the Porcelain
"git diff" command, and once users of such a configuration variable
is used in Doron's fork of Git, those scripts will break for them.

Using alias like you showed won't have such a problem.

```
