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

Re: [PATCH v8] help: add option to colorize man pages under less

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Jun 26, 2021, 14:49 UTC
Message-ID
<877digy8xe.fsf@evledraar.gmail.com>
In-Reply-To
<20210626025040.104428-1-felipe.contreras@gmail.com>
On Fri, Jun 25 2021, Felipe Contreras wrote:
Show 8 quoted lines
> This a reroll of Ævar's v7 with comments from Jeff King so that
> color.ui=never doesn't disable color.man, and the documentation was
> updated accordingly.
>
> Additinally I removed one call to colorize_man() in exec_man_cmd() which
> is not meant for the man command (although it could be used for that).
>
> Plus a bunch of style changes to the commit message.

This version looks good to me, thanks for the style & grammar fixes on my commit message additions.

Show 8 quoted lines
>           1. color.man=true must be set in the config
>           2. The user must use less
>           3. Not have the same LESS_TERMCAP variables set (we call setenv(3) with overwrite=0)
>     -     4. Have color.ui enabled
>     -     5. Not have color.pager disabled
>     -     6. Not have git with stdout directed to a file
>     +     4. Not have color.pager disabled
>     +     5. Not have git with stdout directed to a file
Even better.
Show 13 quoted lines
>  static struct cmdnames main_cmds, other_cmds;
> diff --git a/color.h b/color.h
> index 98894d6a17..d012add4e8 100644
> --- a/color.h
> +++ b/color.h
> @@ -51,6 +51,7 @@ struct strbuf;
>  #define GIT_COLOR_FAINT		"\033[2m"
>  #define GIT_COLOR_FAINT_ITALIC	"\033[2;3m"
>  #define GIT_COLOR_REVERSE	"\033[7m"
> +#define GIT_COLOR_UNDERLINE	"\033[4m"
>  
>  /* A special value meaning "no color selected" */
>  #define GIT_COLOR_NIL "NIL"

Not really needing, but I note that this adds something that we don't have in test_decode_color(), not that we're testing this output directly, so it doesn't matter for now.

Previous: Felipe Contreras
Message 22 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.