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

[RFC PATCH 0/2] gitk --color-words

From
Thomas Rast <trast@student.ethz.ch>
Date
Mar 31, 2010, 00:52 UTC
Message-ID
<cover.1269996525.git.trast@student.ethz.ch>
This little pair of patches teaches gitk a color-words diff view.

To get there, I finally got rid of the assumption that --color-words only ever needs to output ANSI(?) color sequences. Hopefully this will help other people to use --color-words in nice frontends.

It uses an ad-hoc output format where newlines in the output are insignificant (so as to be able to speak about added/removed words) and newlines from the input are output as a line with only a '~'.

RFC among other things because
* I chose ~ more or less randomly.  Do any diff implementations out
  there use it for some other purpose?
* The --color-words code was the only user of color_fwrite_lines() so
  I tweaked it according to my needs.  But that makes it highly
  diff-specific again, so it's not in color.c any more.  Did anyone
  else intend to use it?
* The Tk part of the patch is 95% voodoo of the
  cut&paste-from-elsewhere vintage and I have no clue whether it works
  only by accident
* I still need to do some things: add docs for --porcelain, add tests
  to the first patch, move the gitk patch to affect only the subtree
* I'm not even burning midnight oil any more
Thomas Rast (2):
  Add diff --porcelain option for --color-words
  gitk: add the equivalent of diff --color-words
 color.c       |   28 ---------------
 color.h       |    1 -
 diff.c        |  105 +++++++++++++++++++++++++++++++++++++++++++++++---------
 diff.h        |    1 +
 gitk-git/gitk |   29 +++++++++++++++-
 5 files changed, 116 insertions(+), 48 deletions(-)
Next: Thomas Rast
Message 1 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.