Another look?
- From
Harald Nordgren <haraldnordgren@gmail.com>
- Date
- Jan 5, 2026, 09:15 UTC
- Message-ID
- <20260105091517.86301-1-haraldnordgren@gmail.com>
- In-Reply-To
- <xmqqa4ysn7a5.fsf@gitster.g>
Show 24 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!".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