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

Re: [PATCH] Colourise git-branch output

From
Linus Torvalds <torvalds@osdl.org>
Date
Dec 12, 2006, 05:41 UTC
Message-ID
<Pine.LNX.4.64.0612112135360.6452@woody.osdl.org>
In-Reply-To
<7vejr5zoqe.fsf@assigned-by-dhcp.cox.net>
On Mon, 11 Dec 2006, Junio C Hamano wrote:
Show 10 quoted lines
> 
> 	[color]
>         	diff = auto
>                 branch = auto
>                 # it begs "* = auto" entry perhaps...
> 	[color.diff]
>         	old = red
>                 new = green
> 	[color.branch]
>         	remote = purple
I wish you'd learn to use the proper syntax ;)
It would be
	[color "diff"]
		old = red
		new = green
and what's nice about it is that you can also do
	[color "diff"]
		auto
		old = red
		new = green

and the config file rules for booleans are such that a config variable without the "= val" part parses the same as "= true", so you can now do

	git repo-config --bool color.diff.auto
and it will say "true".
Now, I just think that would be a nice syntax.

Of course, for legacy reasons, and for people who rather than keeping the _color_ information together want to keep the _diff_ information together, we can/probably-should support both color.diff.* and diff.color.* formats.

Previous: Junio C HamanoNext: Junio C Hamano
Message 8 of 9 in “Colourise git-branch output”
  1. Colourise git-branch outputAndy Parkins, Dec 11, 2006
  2. Junio C HamanoDec 11, 2006
  3. SeanDec 12, 2006
  4. Junio C HamanoDec 12, 2006
  5. SeanDec 12, 2006
  6. Linus TorvaldsDec 12, 2006
  7. Junio C HamanoDec 12, 2006
  8. Linus TorvaldsDec 12, 2006
  9. Junio C HamanoDec 12, 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.