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.