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

Re: [PATCH] Colorized git log

From
SCSteven Cole <elenstev@mesatop.com>
Date
Apr 22, 2005, 01:04 UTC
Message-ID
<200504211904.18283.elenstev@mesatop.com>
In-Reply-To
<20050422005452.GZ7443@pasky.ji.cz>
On Thursday 21 April 2005 06:54 pm, Petr Baudis wrote:
Show 28 quoted lines
> Duh. And they say "Where possible terminfo is consulted to find the
> string to use." in their manual page. :/
> 
> > gitlog.sh: 6d24d857fb6c2f7e810954adaca1990599906f07
> > --- a/gitlog.sh
> > +++ b/gitlog.sh
> > @@ -11,11 +11,11 @@
> >  
> >  if [ "$1" = "-c" ]; then
> >  	shift
> > -	colheader=$(setterm -foreground green)
> > -	colauthor=$(setterm -foreground cyan)
> > -	colcommitter=$(setterm -foreground magenta)
> > -	colsignoff=$(setterm -foreground yellow)
> > -	coldefault=$(setterm -foreground default)
> > +	colheader="$(tput setaf 2)"
> > +	colauthor="$(tput setaf 6)"
> > +	colcommitter="$(tput setaf 5)"
> > +	colsignoff="$(tput setaf 3)"
> > +	coldefault="$(tput op)"
> >  else
> >  	colheader=
> >  	colauthor=
> 
> Please at least stick the colors in comments after the assignment.
> Not everyone knows ANSI color codes off-hand (the last thing I've
> memorized were BIOS color codes in the distant DOS days).
> 

I like the color idea, but since many people have their own idea of what colors are appropriate, etc (I use a dark background, and the magenta is painful), perhaps we could have a LOG_COLORS file, similar in concept (but more readable) to the /etc/DIR_COLORS file. Great work !

Steven
Previous: Daniel Serpell
Message 6 of 6 in “Colorized git log”
  1. SeanApr 21, 2005
  2. Petr BaudisApr 21, 2005
  3. Colorized git logDaniel Serpell, Apr 22, 2005
  4. Petr BaudisApr 22, 2005
  5. Daniel SerpellApr 22, 2005
  6. Steven ColeApr 22, 2005

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.