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

Re: [PATCHv3 2/4] builtin/blame: dim uninteresting metadata

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 8, 2018, 19:34 UTC
Message-ID
<xmqqk1ws87qw.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20180104224007.214548-3-sbeller@google.com>
Stefan Beller <sbeller@google.com> writes:
Show 6 quoted lines
> +color.blame.repeatedMeta::
> +	Use the customized color for the part of git-blame output that
> +	is repeated meta information per line (such as commit id,
> +	author name, date and timezone). Defaults to dark gray.
> +
> ...

"Dark gray on default background" may alleviate worrries from those who prefer black ink on white paper display by hinting that both foreground and background colors can be configured.

Do we want to make this overridable from the command line, i.e. --color-repeated-meta=gray?

> +#define OUTPUT_COLOR_LINE	02000

The name of the macro implies that this is (or at least can be) a lot more generic UI request than merely "paint the same metadata on adjacent lines in a different color".

> +		OPT_BIT(0, "color-lines", &output_option, N_("color redundant metadata from previous line differently"), OUTPUT_COLOR_LINE),

Should this eventually become "--color=<yes,no,auto>" that is more usual and generic, possibly defaulting to "auto" in the future, I wonder?

Show 12 quoted lines
> diff --git a/color.h b/color.h
> index 2e768a10c6..2df2f86698 100644
> --- a/color.h
> +++ b/color.h
> @@ -30,6 +30,7 @@ struct strbuf;
>  #define GIT_COLOR_BLUE		"\033[34m"
>  #define GIT_COLOR_MAGENTA	"\033[35m"
>  #define GIT_COLOR_CYAN		"\033[36m"
> +#define GIT_COLOR_DARK		"\033[1;30m"
>  #define GIT_COLOR_BOLD_RED	"\033[1;31m"
>  #define GIT_COLOR_BOLD_GREEN	"\033[1;32m"
>  #define GIT_COLOR_BOLD_YELLOW	"\033[1;33m"

How about using CYAN just like "diff" output uses it to paint the least interesting lines? That way we will keep the "uninteresting is cyan" consistency for the default settings without adding a new color to the palette.

Previous: Stefan BellerNext: Stefan Beller
Message 10 of 17 in “blame: (dim rep. metadata lines or fields, decay date coloring)”
  1. 0/4 blame: (dim rep. metadata lines or fields, decay date coloring)Stefan Beller, Nov 10, 2017
  2. 1/4 color.h: modernize headerStefan Beller, Nov 10, 2017
  3. 2/4 builtin/blame: dim uninteresting metadataStefan Beller, Nov 10, 2017
  4. 3/4 builtin/blame: add option to color metadata fields separatelyStefan Beller, Nov 10, 2017
  5. 4/4 builtin/blame: highlight recently changed linesStefan Beller, Nov 10, 2017
  6. 0/4 blame: (dim rep. metadata lines or fields, decay date coloring)Stefan Beller, Jan 4, 2018
  7. 1/4 color.h: document and modernize headerStefan Beller, Jan 4, 2018
  8. Junio C HamanoJan 8, 2018
  9. 2/4 builtin/blame: dim uninteresting metadataStefan Beller, Jan 4, 2018
  10. Junio C HamanoJan 8, 2018
  11. Stefan BellerFeb 8, 2018
  12. 4/4 builtin/blame: highlight recently changed linesStefan Beller, Jan 4, 2018
  13. Junio C HamanoJan 8, 2018
  14. Stefan BellerJan 8, 2018
  15. 3/4 builtin/blame: add option to color metadata fields separatelyStefan Beller, Jan 4, 2018
  16. Ævar Arnfjörð BjarmasonFeb 1, 2018
  17. Stefan BellerFeb 1, 2018

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.