git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] status: reword message for a missing upstream branch

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 19, 2026, 16:41 UTC
Message-ID
<xmqqik1szsce.fsf@gitster.g>
In-Reply-To
<20261119055026.759205-1-gitter.spiros@gmail.com>
Elia Pinto <gitter.spiros@gmail.com> writes:
Show 6 quoted lines
> The same check again: no push refspec matches 'master', so
> branch_get_push_1() fails with "push refspecs for 'origin' do not
> include 'master'", push_ref is NULL and we return false. The refspec
> and mirror tests only come into play once we know that @{push} is the
> upstream; they are there because push.default is not consulted at all
> when either is set.

Ahh, that is where the trickiness lies. So the "mirror or has any push refspec" check is about "should we check what the default say?"

That may deserve a comment, as you said below.
Show 21 quoted lines
>> You mentioned "nothing" in the log message; shouldn't that also be
>> special cased?
>
> With push.default=nothing @{push} does not resolve either, so it ends
> up in the same place; 'status (missing upstream, push.default=nothing)'
> in t6040 covers it. "matching" is the only mode in which @{push}
> resolves to the upstream although "git push" would not create it, hence
> the special case.
>
> None of this is said in the comment above push_creates(), which is why
> it raises these questions. In v3 I will spell it out there and add
> tests for the mirror and the narrow refspec cases.
>
>> But we call push_creates() to compute suggest_push whether we have
>> advice enabled or declined.  I wonder if it makes the logic flow
>> cleaner to give a few more arguments to format_missing_upstream()
>> and move push_creates() call there, not here?
>
> Yes, that reads better. I will do it in v3.
>
> Thanks for the review.
Thanks.
Previous: Elia PintoNext: Elia Pinto
Message 12 of 14 in “status: reword message for a missing upstream branch”
  1. status: reword message for a missing upstream branchElia Pinto, Oct 19, 2026
  2. Harald NordgrenOct 19, 2026
  3. Junio C HamanoOct 19, 2026
  4. Elia PintoOct 20, 2026
  5. status: reword message for a missing upstream branchElia Pinto, Oct 21, 2026
  6. Elia PintoOct 30, 2026
  7. Elia PintoNov 17, 2026
  8. Harald NordgrenNov 17, 2026
  9. Junio C HamanoNov 17, 2026
  10. Junio C HamanoNov 18, 2026
  11. Elia PintoNov 19, 2026
  12. Junio C HamanoNov 19, 2026
  13. status: reword message for a missing upstream branchElia Pinto, Nov 19, 2026
  14. Junio C HamanoNov 19, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.