Subject: Another look?

From: Harald Nordgren <[email-masked]>
Date: Mon, 5 Jan 2026 10:15:17 +0100

> > -     } 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!".

Agreed! This change was done to get rid of sti as a parameter. Maybe I
misunderstood your previous comment around the sti.

I will bring back sti as a parameter to ’format_branch_comparison’ now,
I don’t see any other way to solve this.

Harald