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

Re: [PATCH v7] help: colorize man pages if man.color=true under less(1)

From
Jeff King <peff@peff.net>
Date
Jun 24, 2021, 00:08 UTC
Message-ID
<YNPM4yvk/71oeAPx@coredump.intra.peff.net>
In-Reply-To
<patch-1.1-a950ef49e28-20210621T083254Z-avarab@gmail.com>
On Mon, Jun 21, 2021 at 10:34:00AM +0200, Ævar Arnfjörð Bjarmason wrote:
Show 13 quoted lines
> diff --git a/Documentation/config/color.txt b/Documentation/config/color.txt
> index e05d520a867..2f12ae3386d 100644
> --- a/Documentation/config/color.txt
> +++ b/Documentation/config/color.txt
> @@ -126,6 +126,12 @@ color.interactive.<slot>::
>  	or `error`, for four distinct types of normal output from
>  	interactive commands.
>  
> +color.man::
> +	This flag can be used to enable the automatic colorizaton of man
> +	pages when using the less pager, `false` by default. When set to
> +	`true` it's activated only when `color.ui` allows it, and if
> +	`color.pager` enable (which it is by default).
A few typos here:
diff --git a/Documentation/config/color.txt b/Documentation/config/color.txt
index 2f12ae3386..fcc12df508 100644
--- a/Documentation/config/color.txt
+++ b/Documentation/config/color.txt
@@ -127,10 +127,10 @@ color.interactive.<slot>::
 	interactive commands.
 
 color.man::
-	This flag can be used to enable the automatic colorizaton of man
+	This flag can be used to enable the automatic colorization of man
 	pages when using the less pager, `false` by default. When set to
 	`true` it's activated only when `color.ui` allows it, and if
-	`color.pager` enable (which it is by default).
+	`color.pager` is enabled (which it is by default).
 
 color.pager::
 	A boolean to specify whether `auto` color modes should colorize

The interaction with color.ui seems unusual. Normally it is not a
gate-keeper for specific colorizations, but rather a fallback when
more-specific color config is unspecified. E.g.:

  [color]
  ui = false
  branch = true

would colorize branch output, but nothing else. But from your
description (and I think the code matches this), doing:

  [color]
  ui = false
  man = true

would still disable the man-colors. So there's no way to enable this
feature without enabling colors everywhere else. I think it should
simply be independent of color.ui (with the exception that it may
eventually use it as a fallback like all the other color.* booleans,
_if_ we want to move it to default-to-on).

-Peff
Previous: Felipe ContrerasNext: Junio C Hamano
Message 17 of 22 in “help: colorize man pages”
  1. help: colorize man pagesFelipe Contreras, May 23, 2021
  2. Phillip WoodMay 24, 2021
  3. Felipe ContrerasMay 24, 2021
  4. Ævar Arnfjörð BjarmasonJun 8, 2021
  5. Junio C HamanoJun 8, 2021
  6. Felipe ContrerasJun 8, 2021
  7. help: colorize man pages if man.color=true under less(1)Ævar Arnfjörð Bjarmason, Jun 21, 2021
  8. Phillip WoodJun 21, 2021
  9. Junio C HamanoJun 21, 2021
  10. Felipe ContrerasJun 21, 2021
  11. Ævar Arnfjörð BjarmasonJun 21, 2021
  12. Jeff KingJun 23, 2021
  13. Felipe ContrerasJun 24, 2021
  14. Junio C HamanoJun 28, 2021
  15. Felipe ContrerasJun 28, 2021
  16. Felipe ContrerasJun 21, 2021
  17. Jeff KingJun 24, 2021
  18. Junio C HamanoJun 29, 2021
  19. Felipe ContrerasJun 29, 2021
  20. Felipe ContrerasJun 24, 2021
  21. help: add option to colorize man pages under lessFelipe Contreras, Jun 26, 2021
  22. Ævar Arnfjörð BjarmasonJun 26, 2021

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.