Re: [PATCH v2 2/9] help.c: use puts() instead of printf{,_ln}() for consistency
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 23, 2022, 21:51 UTC
- Message-ID
- <xmqqfso9s14j.fsf@gitster.g>
- In-Reply-To
- <patch-v2-2.9-124643c4b35-20220221T193708Z-avarab@gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
> - printf("\n%s\n", _(desc));
> + putchar('\n');
> + puts(_(desc));This is sort of "Meh". Even the justification that says "we'll do the same thing in future patches" is not really a justification, as it is entirely fine to add more of the "line-break plus %\n" printf() in the later steps in the same series.
Show 9 quoted lines
> print_command_list(cmds, mask, longest);
> }
> free(cmds);
> @@ -317,7 +318,7 @@ void list_commands(struct cmdnames *main_cmds, struct cmdnames *other_cmds)
> }
>
> if (other_cmds->cnt) {
> - printf_ln(_("git commands available from elsewhere on your $PATH"));
> + puts(_("git commands available from elsewhere on your $PATH"));This *IS* an improvement, as the first parameter to printf_ln() is supposed to be a format string, and should have been
printf_ln("%s", _("git commands ..."));> - printf_ln(_("See 'git help <command>' to read about a specific subcommand"));
> + puts(_("See 'git help <command>' to read about a specific subcommand"));Ditto.