Re: A better git diff --word-diff (--word-diff-regex) ?

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: A better git diff --word-diff (--word-diff-regex) ?

From: Matthieu Moy <hidden>
Date: 2016-06-15 22:53:20

Piotr Krukowiecki [off-list ref] writes:
Hi,

is there a way to configure --word-diff to be a more programming
language friendly?
I often use this:

  git diff --color-words=.

It's rather bad on plain text, since it will try to diff within words,
but works well on source code.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

Re: A better git diff --word-diff (--word-diff-regex) ?

From: Piotr Krukowiecki <hidden>
Date: 2016-06-15 22:53:20

On Mon, Mar 19, 2012 at 10:47 AM, Matthieu Moy
[off-list ref] wrote:
Piotr Krukowiecki [off-list ref] writes:
quoted
Hi,

is there a way to configure --word-diff to be a more programming
language friendly?
I often use this:

 git diff --color-words=.

It's rather bad on plain text, since it will try to diff within words,
but works well on source code.
Hi,

thanks for the idea, it's surely useful in many cases, but it can look
confusing on source code too. For example on git b3256eb8b in path.c
one part of the diff is

-                       if (!access(used_path, F_OK)) {
+                       if (!stat(used_path, &st) &&
+                           (S_ISREG(st.st_mode) ||
+                           (S_ISDIR(st.st_mode) &&
is_git_directory(used_path)))) {

and "git diff --word-diff-regex=." shows

                        if (![-acces-]s{+tat+}(used_path, [-F-]{+&st) &&+}
{+                          (S+}_[-OK-]{+ISREG(st.st_mode) ||+}
{+                          (S_ISDIR(st.st_mode) &&
is_git_directory(used_path))+})) {



-- 
Piotr Krukowiecki
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help