All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Beller <stefanbeller@googlemail.com>
To: Chris J Arges <christopherarges@gmail.com>,
	gitster@pobox.com, git@vger.kernel.org
Subject: Re: [PATCH] blame: add color
Date: Tue, 08 Oct 2013 16:39:35 +0200	[thread overview]
Message-ID: <52541927.5010206@googlemail.com> (raw)
In-Reply-To: <1381241929-23378-1-git-send-email-christopherarges@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 930 bytes --]

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.

>  
> +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?

> +
> +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



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]

  reply	other threads:[~2013-10-08 14:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-08 14:18 [PATCH] blame: add color Chris J Arges
2013-10-08 14:39 ` Stefan Beller [this message]
2013-10-08 15:16 ` Junio C Hamano
2013-10-08 16:03   ` Chris J Arges

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52541927.5010206@googlemail.com \
    --to=stefanbeller@googlemail.com \
    --cc=christopherarges@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.