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

Re: [PATCH] blame: add color

From
Stefan Beller <stefanbeller@googlemail.com>
Date
Oct 8, 2013, 14:39 UTC
Message-ID
<52541927.5010206@googlemail.com>
In-Reply-To
<1381241929-23378-1-git-send-email-christopherarges@gmail.com>
On 10/08/2013 04:18 PM, Chris J Arges wrote:
> Add colorized text for git blame when color.interactive is enabled.
> This work is based on the colorization code in builtin/clean.c.
> 

Another way to color blame, would be by commit, not by row. Try "git gui blame <file>", to see what I mean. The colorisation would be per commit and not by line. Though I guess that's a lot of more work, but I'd personally find it better, for what it's worth.

Show 7 quoted lines
>  
> +static const char *blame_get_color(enum color_blame ix)
> +{
> +	if (want_color(blame_use_color))
> +		return blame_colors[ix];
> +	return "";
> +}

The only occurence of blame_get_color is in blame_print_color, so why not move it in there?

Show 7 quoted lines
> +
> +static void blame_print_color(enum color_blame ix)
> +{
> +	printf("%s", blame_get_color(ix));
> +}
> +
>  static const char *format_time(unsigned long time, const char *tz_str,

Thanks, Stefan

Previous: Chris J ArgesNext: Junio C Hamano
Message 2 of 4 in “blame: add color”
  1. blame: add colorChris J Arges, Oct 8, 2013
  2. Stefan BellerOct 8, 2013
  3. Junio C HamanoOct 8, 2013
  4. Chris J ArgesOct 8, 2013

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.