git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 3, 2010, 19:15 UTC
Message-ID
<7vmxxk8i01.fsf@alter.siamese.dyndns.org>
In-Reply-To
<f5741e49b2c09ec76def2d21a84a7da6ff7b8368.1270317502.git.trast@student.ethz.ch>
Thomas Rast <trast@student.ethz.ch> 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.

Previous: Thomas RastNext: Miles Bader
Message 7 of 11 in “gitk --color-words”
  1. 0/2 gitk --color-wordsThomas Rast, Mar 31, 2010
  2. 1/2 Add diff --porcelain option for --color-wordsThomas Rast, Mar 31, 2010
  3. 2/2 gitk: add the equivalent of diff --color-wordsThomas Rast, Mar 31, 2010
  4. Thomas RastMar 31, 2010
  5. 0/2 gitk --color-wordsThomas Rast, Apr 3, 2010
  6. 1/2 Add diff --porcelain option for --color-wordsThomas Rast, Apr 3, 2010
  7. Junio C HamanoApr 3, 2010
  8. Miles BaderApr 3, 2010
  9. 2/2 gitk: add the equivalent of diff --color-wordsThomas Rast, Apr 3, 2010
  10. Paul MackerrasApr 5, 2010
  11. Thomas RastApr 5, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.