From: Junio C Hamano <gitster@pobox.com>
To: Chris J Arges <christopherarges@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] blame: add color
Date: Tue, 08 Oct 2013 08:16:38 -0700 [thread overview]
Message-ID: <xmqqob6zn67d.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <1381241929-23378-1-git-send-email-christopherarges@gmail.com> (Chris J. Arges's message of "Tue, 8 Oct 2013 09:18:49 -0500")
Chris J Arges <christopherarges@gmail.com> writes:
> Add colorized text for git blame when color.interactive is enabled.
It does not make any sense to tie this to color.interactive at all,
at least to me. The "check color.blame and if absent fall back to
color.ui", which is the usual pattern, would be more appropriate.
> +static char blame_colors[][COLOR_MAXLEN] = {
> + GIT_COLOR_RESET,
> + GIT_COLOR_NORMAL, /* PLAIN */
> + GIT_COLOR_YELLOW, /* COMMIT */
> + GIT_COLOR_BOLD, /* NAME */
> + GIT_COLOR_CYAN, /* LINE */
> + GIT_COLOR_GREEN, /* TIME */
> +};
Unlike "git grep", where some pieces of a single line are more
interesting (i.e. the exact text matching the pattern given) than
others (i.e. other text on the same line), and "git diff", where
some lines have different meanings from others (i.e. hunk header,
deleted lines, added lines, context lines), the output from "git
blame" is already columnar and it is obvious to the reader of the
output that everything on the leftmost part of all lines is commit
object name, without distraction of extra colours; I do not see much
point in painting the output into vertical stripes of colours.
It may make more sense to assign one colour to each blame origin
(i.e. <commit, path> pair), to make it clear that first five lines
came from the same origin that is different from the two lines that
follow, etc., showing horizontal stripes of colours. If we were to
go that route, I suspect that it would be too distracting to paint
the whole line (like "git diff" does for added or deleted
lines). Perhaps paint only the commit object name part in different
colors to show which lines form a group that came from the same
origin? The way "git show-branch" paints its output might give an
inspiration.
next prev parent reply other threads:[~2013-10-08 15:16 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
2013-10-08 15:16 ` Junio C Hamano [this message]
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=xmqqob6zn67d.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=christopherarges@gmail.com \
--cc=git@vger.kernel.org \
/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.