Re: [PATCH] remote: use plural-only message for diverged branch status
"Harald Nordgren via GitGitGadget" <gitgitgadget@gmail.com> writes:
> From: Harald Nordgren <haraldnordgren@gmail.com>
>
> Drop Q_() singular form and use _() with the plural string only.
I know the commit title talks about plural-only, but please make sure that the body of the log message carries all the necessary information to justify the change standalone. "In the else clause, both ours and theirs are positive integers so ours+theirs must be at least 2, hence there is no need to prepare singular and plural variants of the message", or something to that effect, perhaps.
The patch text and the reasoning behind it does sound familiar and I vaguely recall discussing about it ;-)
Thanks.
Show 33 quoted lines
> Signed-off-by: Harald Nordgren <haraldnordgren@gmail.com>
> ---
> format_branch_comparison: diverged message has only plural case
>
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2239%2FHaraldNordgren%2Fformat_branch_comparison__plural-v1
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2239/HaraldNordgren/format_branch_comparison__plural-v1
> Pull-Request: https://github.com/git/git/pull/2239
>
> remote.c | 9 ++-------
> 1 file changed, 2 insertions(+), 7 deletions(-)
>
> diff --git a/remote.c b/remote.c
> index 7ca2a6501b..12136dfa23 100644
> --- a/remote.c
> +++ b/remote.c
> @@ -2307,13 +2307,8 @@ static void format_branch_comparison(struct strbuf *sb,
> _(" (use \"git pull\" to update your local branch)\n"));
> } else {
> strbuf_addf(sb,
> - Q_("Your branch and '%s' have diverged,\n"
> - "and have %d and %d different commit each, "
> - "respectively.\n",
> - "Your branch and '%s' have diverged,\n"
> - "and have %d and %d different commits each, "
> - "respectively.\n",
> - ours + theirs),
> + _("Your branch and '%s' have diverged,\n"
> + "and have %d and %d different commits each, respectively.\n"),
> branch_name, ours, theirs);
> if (use_divergence_advice && advice_enabled(ADVICE_STATUS_HINTS))
> strbuf_addstr(sb,
>
> base-commit: dc6ecd5354dca88d51b6d6562777fc8fc10d77e1