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