git@vger.kernel.org mailing list mirror (one of many)
 help / Atom feed
* 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
@ 2018-04-14 20:02 Doron Behar
  2018-04-14 20:07 ` Ævar Arnfjörð Bjarmason
  0 siblings, 1 reply; 3+ messages in thread
From: Doron Behar @ 2018-04-14 20:02 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 202 bytes --]

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`.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 691 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* 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
  2018-04-14 20:02 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 Doron Behar
@ 2018-04-14 20:07 ` Ævar Arnfjörð Bjarmason
  2018-04-15 21:13   ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2018-04-14 20:07 UTC (permalink / raw)
  To: Doron Behar; +Cc: git


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"

?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* 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
  2018-04-14 20:07 ` Ævar Arnfjörð Bjarmason
@ 2018-04-15 21:13   ` Junio C Hamano
  0 siblings, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2018-04-15 21:13 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: Doron Behar, git

Æ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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-14 20:02 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 Doron Behar
2018-04-14 20:07 ` Ævar Arnfjörð Bjarmason
2018-04-15 21:13   ` Junio C Hamano

git@vger.kernel.org mailing list mirror (one of many)

Archives are clonable:
	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.org/gmane.comp.version-control.git

 note: .onion URLs require Tor: https://www.torproject.org/
       or Tor2web: https://www.tor2web.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox