Re: [PATCH v16 1/2] refactor format_branch_comparison in preparation
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 5, 2026, 02:05 UTC
- Message-ID
- <xmqqa4ysn7a5.fsf@gitster.g>
- In-Reply-To
- <cf4e9779c5d47b22bd4a04fd9b2b138d5602145a.1767568882.git.gitgitgadget@gmail.com>
"Harald Nordgren via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 17 quoted lines
> - } else if (!sti) {
> - strbuf_addf(sb,
> - _("Your branch is up to date with '%s'.\n"),
> - base);
> - } else if (abf == AHEAD_BEHIND_QUICK) {
> + if (abf == AHEAD_BEHIND_QUICK) {
> strbuf_addf(sb,
> _("Your branch and '%s' refer to different commits.\n"),
> - base);
> + branch_name);
> if (advice_enabled(ADVICE_STATUS_HINTS))
> strbuf_addf(sb, _(" (use \"%s\" for details)\n"),
> "git status --ahead-behind");
> + } else if (!ours && !theirs) {
> + strbuf_addf(sb,
> + _("Your branch is up to date with '%s'.\n"),
> + branch_name);We used to check if there is nothing to report (i.e., !sti is a signal from stat_tracking_info() that there are no differences between the branches) and reported that first, so when abf was checked, we knew that there are some differences. Now, your patch reverses the order so whether there is or is not a change, abf codepath will always report "you have differences!".
This smells iffy.