Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH v2 1/2] Add diff --porcelain option for --color-words

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:48:33

Thomas Rast [off-list ref] writes:
This teaches the --color-words mode a new option --porcelain that
disables color mode again and instead uses an ad-hoc format for the
word diff designed for machine reading.
How readable can you make this for human consumption while still keeping
it machine readable?  The answer could be it already is human readble.

Two reasons I ask the above question are that I find the feature quite
interesting, and would want to see if it can be also fed to humans, and
that the combination of this new option and the existing --color-words is
misnamed.

What you are giving "git diff" is "word-level diff" as opposed to the
usual "line-level diff", isn't it?  The machinery may have already been
there, but it had a hardwired representation of the result to color pre-
and post- image words, and you are giving the result from the machinery
another representation with this patch.  If you call this --word-diff,
then it would become more clear that --color-words perhaps should have
been called --word-diff=color or something.

Besides, --porcelain invites "what does it do without --color-words?", to
which you wouldn't have a good answer, as non word-diff output is already
machine readable.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help