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

Re: [RFC] Syntax highlighting for combined diff

From
Junio C Hamano <junkio@cox.net>
Date
Oct 21, 2006, 07:48 UTC
Message-ID
<7vslhigld7.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<ehbq0k$24l$1@sea.gmane.org>
Jakub Narebski <jnareb@gmail.com> writes:
Show 6 quoted lines
> So the question is how to color combined diff format (what should be syntax
> highlighting for combined diff format). If branches columns have only
> pluses we use the same color as for adding line in ordinary diff; if
> branches column consist only of minuses we use the same color as for
> removing line in ordinary diff. Can there be mixture of plusses and
> minuses? How git-diff --color solves this?
UTSL ;-).

Otherwise (iow, if you refuse to use the source), you could cheat and let "git diff" do the coloring for you, and then regexp replace the output. You could even use the same coloring logic for normal diff if you did so.

Previous: Jakub NarebskiNext: Jakub Narebski
Message 2 of 6 in “[RFC] Syntax highlighting for combined diff”
  1. Jakub NarebskiOct 21, 2006
  2. Junio C HamanoOct 21, 2006
  3. Jakub NarebskiOct 21, 2006
  4. Junio C HamanoOct 21, 2006
  5. Jakub NarebskiOct 21, 2006
  6. Junio C HamanoOct 21, 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.