Re: [PATCH v10 5/5] help: respect new common command grouping

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 21, 2015 at 9:13 AM, Sébastien Guimmara
<sebastien.guimmara@xxxxxxxxx> wrote:
> 'git help' shows common commands in alphabetical order:
> [...]
> without any indication of how commands relate to high-level
> concepts or each other. Revise the output to explain their relationship
> with the typical Git workflow:
> [...]
> Signed-off-by: Sébastien Guimmara <sebastien.guimmara@xxxxxxxxx>
> ---
> diff --git a/help.c b/help.c
> index 2072a87..8f72051 100644
> --- a/help.c
> +++ b/help.c
> @@ -218,17 +218,39 @@ void list_commands(unsigned int colopts,
>  void list_common_cmds_help(void)
>  {
>         int i, longest = 0;
> +       int current_grp = -1;
>
>         for (i = 0; i < ARRAY_SIZE(common_cmds); i++) {
>                 if (longest < strlen(common_cmds[i].name))
>                         longest = strlen(common_cmds[i].name);
>         }
>
> -       puts(_("The most commonly used git commands are:"));
> +       qsort(common_cmds, ARRAY_SIZE(common_cmds),
> +               sizeof(common_cmds[0]), cmd_group_cmp);
> +
> +       puts(_("These are common Git commands used in various situations:"));

The clause "in various situations" is quite nebulous and thus adds no
substance. If you remove it, then you're effectively left with the
original

    "The most commonly used git commands are:"

which reads just as well or better and has the attribute of being more
concise. I'd opt to drop this change and just keep the original
wording.

Other than that minor observation, the patch looks fine.

> +
>         for (i = 0; i < ARRAY_SIZE(common_cmds); i++) {
> +               if (common_cmds[i].group != current_grp) {
> +                       printf("\n%s\n", _(common_cmd_groups[common_cmds[i].group]));
> +                       current_grp = common_cmds[i].group;
> +               }
> +
>                 printf("   %s   ", common_cmds[i].name);
>                 mput_char(' ', longest - strlen(common_cmds[i].name));
>                 puts(_(common_cmds[i].help));
> --
> 2.4.0.GIT
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]