Re: [PATCH v19 2/2] status: show comparison with push remote tracking branch
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 10, 2026, 02:13 UTC
- Message-ID
- <xmqqbjj2tdu0.fsf@gitster.g>
- In-Reply-To
- <dc8ab23158e5b43cf650f71ef5c2b3a094f54129.1767984037.git.gitgitgadget@gmail.com>
"Harald Nordgren via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 10 quoted lines
> @@ -2285,8 +2352,7 @@ static void format_branch_comparison(struct strbuf *sb,
> "respectively.\n",
> ours + theirs),
> branch_name, ours, theirs);
> - if (show_divergence_advice &&
> - advice_enabled(ADVICE_STATUS_HINTS))
> + if (want_divergence_advice)
> strbuf_addstr(sb,
> _(" (use \"git pull\" if you want to integrate the remote branch with yours)\n"));
> }This is not a new issue introduced by this series, but it is curious there is "ours + theirs" there #leftoverbits.
It is part of ngetext() aka Q_() call, used this way:
} 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),
branch_name, ours, theirs);But in this if/else if/... cascade, we have ruled out cases where either/both of ours and theirs is 0 already, so ours + theirs has to be at least two (because each has to be at least one). Q_() based on a value that is always plural would always use the latter form (i.e., "commits").