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

Re: [RFC] Add the --color-words option to the diff options family

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jul 31, 2006, 11:00 UTC
Message-ID
<Pine.LNX.4.63.0607311257000.29667@wbgn013.biozentrum.uni-wuerzburg.de>
In-Reply-To
<7vbqr66o4e.fsf@assigned-by-dhcp.cox.net>
Hi,
On Mon, 31 Jul 2006, Junio C Hamano wrote:
Show 10 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> > With this option, the changed words are shown inline. For example,
> > if a file containing "This is foo" is changed to "This is bar", the diff
> > will now show "This is " in plain text, "foo" in red, and "bar" in green.
> >
> > Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
> 
> This looks sooooooooooo strange (and I do not particularly like
> colours, so I am biased).

I thought so, too, after playing around with wdiff. But I do use it regularly, and it is helpful. It is my equivalent to the word processor option to show all changes (yes, live and in colour).

> We might want to disable it when the output would not be colored under 
> diff.color = auto, at least, but if the user asks to shoot himself in 
> the foot that is fine as well ;-).

At the moment, this is _only_ enabled when the user explicitely asks for it: no --color-words, no word colours. Do you want to be able to say "git-diff --color-words | patch -p1 -R"?

Ciao, Dscho

Previous: Junio C Hamano
Message 5 of 5 in “[RFC] Add the --color-words option to the diff options family”
  1. Johannes SchindelinJul 28, 2006
  2. Matthias LederhoferJul 30, 2006
  3. Johannes SchindelinJul 30, 2006
  4. Junio C HamanoJul 31, 2006
  5. Johannes SchindelinJul 31, 2006

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.