Re: [PATCH v2 4/5] Make boundary characters for --color-words configurable
From: Jakub Narebski <hidden>
Date: 2016-06-15 22:44:34
Junio C Hamano [off-list ref] writes:
Let's step back a bit and try to clarify the problem with a bit of
illustration.
The motivation behind "word diff" is because line oriented diff is
sometimes unwieldy.
-Hello world.
+Hi, world.[...]
We instead can do this word by word (note that I am doing this as a
thought experiment, to illustrate what the problem is and what should
conceptually happen, not suggesting this particular implementation):
preimage postimage word-diff
48656c6c6f -48656c6c6f Hello
4869 +4869 Hi
2c +2c ,
20 20 20 ' '
776f726c64 776f726c64 776f726c64 world
2e 2e 2e .
0a 0a 0a '\n'
Which would give you "/Hello/Hi,/ world.\n".
Would it be possible instead of in-line word diff, use word coloring
to enhance traditional diff format? Something like
-/Hello/ world.
+/Hi,/ world.
(We could use bold, or reverse for marking changed fragment, or use
color only for changed fragment).
IMHO current output is nice, unless you have long lines and not very
wide screen...
--
Jakub Narebski
Poland
ShadeHawk on #git