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

Re: RFC: git diff colorization idea

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 23, 2009, 06:45 UTC
Message-ID
<7vfxja34hx.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<5034E8A9-2B17-4368-8EDF-5FEE61BB2BAD@wincent.com>
Wincent Colaiuta <win@wincent.com> writes:
Show 7 quoted lines
>>> Any feedback or suggestions before I get in too deep?
>>
>> I personally find your "prposal" picture too loud to my eye.
>
> Yes, mine too. I wouldn't actually use those colors in practice.  
> (Doubly so because the "removed" color looks like the "whitespace  
> error" color.)

I did not mean that your choice of colors is loud. Not at all. What I meant was the use of color _everywhere_ makes it too loud, and also the use of _larger number of_ colors makes it too loud.. In other words, you are painting the output more than what the current output does, and that made me find it too loud, no matter what the choice of colors are.

You might have misunderstood my illustration, but what I meant to suggest was to leave most of the characters on both - and + lines in monochrome (or whatever the "normal" is), and paint _only_ the words that are different. The outcome would become _less_ colorful than the current "whole -/+ lines are painted" output, but "only different words are coloured; the words that are unmodified are left uncoloured, without distracting the eyes." Much less louder than even the current one, yet giving more information.

As -/+ has a marker value, I think colouring them may be Ok, too. That would make something like this:

  | {
  |<red>-</red>    <gray>local subcommands="add rm show prune<gray> <red>update</red>"
  |<green>+</green>    local subcommands="add <green>rename</green> rm show prune"
  |     if ...
Previous: Wincent ColaiutaNext: Nanako Shiraishi
Message 4 of 6 in “RFC: git diff colorization idea”
  1. Wincent ColaiutaJan 23, 2009
  2. Junio C HamanoJan 23, 2009
  3. Wincent ColaiutaJan 23, 2009
  4. Junio C HamanoJan 23, 2009
  5. Nanako ShiraishiJan 23, 2009
  6. Jakub NarebskiJan 23, 2009

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.