git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Duy Nguyen <pclouds@gmail.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH] git help: promote 'git help -av'
Date: Sun, 23 Sep 2018 08:51:06 +0200	[thread overview]
Message-ID: <CACsJy8CjZ+eupz+j5go2bRbSyf-cXWvCJkPFjfDejj89Z3j9ig@mail.gmail.com> (raw)
In-Reply-To: <87fty1jppt.fsf@evledraar.gmail.com>

On Sat, Sep 22, 2018 at 9:29 PM Ævar Arnfjörð Bjarmason
<avarab@gmail.com> wrote:
>
>
> On Sat, Sep 22 2018, Nguyễn Thái Ngọc Duy wrote:
>
> > When you type "git help" (or just "git") you are greeted with a list
> > with commonly used commands and their short description and are
> > suggested to use "git help -a" or "git help -g" for more details.
> >
> > "git help -av" would be more friendly and inline with what is shown
> > with "git help" since it shows list of commands with description as
> > well, and commands are properly grouped.
> >
> > Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> > ---
> >  git.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/git.c b/git.c
> > index a6f4b44af5..69c21f378b 100644
> > --- a/git.c
> > +++ b/git.c
> > @@ -31,7 +31,7 @@ const char git_usage_string[] =
> >          "           <command> [<args>]");
> >
> >  const char git_more_info_string[] =
> > -     N_("'git help -a' and 'git help -g' list available subcommands and some\n"
> > +     N_("'git help -av' and 'git help -g' list available subcommands and some\n"
> >          "concept guides. See 'git help <command>' or 'git help <concept>'\n"
> >          "to read about a specific subcommand or concept.");
>
> A side-effect of this not noted in your commit message is that we'll now
> invoke the pager, perhaps we should just do:
>
>     diff --git a/builtin/help.c b/builtin/help.c
>     index 8d4f6dd301..1a3b174aaf 100644
>     --- a/builtin/help.c
>     +++ b/builtin/help.c
>     @@ -436,9 +436,9 @@ int cmd_help(int argc, const char **argv, const char *prefix)
>             parsed_help_format = help_format;
>
>             if (show_all) {
>     +               setup_pager();
>                     git_config(git_help_config, NULL);
>                     if (verbose) {
>     -                       setup_pager();
>                             list_all_cmds_help();
>                             return 0;
>                     }
>     @@ -460,8 +460,10 @@ int cmd_help(int argc, const char **argv, const char *prefix)
>                     return 0;
>             }
>
>     -       if (show_guides)
>     +       if (show_guides) {
>     +               setup_pager();
>                     list_common_guides_help();
>     +       }
>
>             if (show_all || show_guides) {
>                     printf("%s\n", _(git_more_info_string));
>
> Or is there a good reason we shouldn't invoke the pager for e.g. -g when
> the terminal is too small (per our default less config)?

Different pagers may behave differently (and so far "help -a" still
fits in my screen). So I don't think we should invoke pager more than
necessary.
-- 
Duy

  reply	other threads:[~2018-09-23  6:51 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-22 17:47 [PATCH] git help: promote 'git help -av' Nguyễn Thái Ngọc Duy
2018-09-22 19:29 ` Ævar Arnfjörð Bjarmason
2018-09-23  6:51   ` Duy Nguyen [this message]
2018-09-24 18:19 ` Jeff King
2018-09-24 20:20   ` Taylor Blau
2018-09-24 20:30     ` Jeff King
2018-09-24 20:58   ` Junio C Hamano
2018-09-25 15:15     ` Duy Nguyen
2018-09-25 17:44       ` Duy Nguyen
2018-09-25 20:54         ` Jeff King
2018-09-26 16:18           ` Duy Nguyen
2018-09-26 17:25             ` Junio C Hamano
2018-09-26 17:28         ` Junio C Hamano
2018-09-28  2:37           ` Taylor Blau
2018-09-28 16:30             ` Junio C Hamano
2018-09-28 17:49               ` Taylor Blau
2018-09-29  6:08 ` [PATCH v2] help -a: improve and make --verbose default Nguyễn Thái Ngọc Duy
2018-10-01 18:14   ` Taylor Blau

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CACsJy8CjZ+eupz+j5go2bRbSyf-cXWvCJkPFjfDejj89Z3j9ig@mail.gmail.com \
    --to=pclouds@gmail.com \
    --cc=avarab@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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).