From: Junio C Hamano <gitster@pobox.com>
To: Elia Pinto <gitter.spiros@gmail.com>
Cc: git@vger.kernel.org, "Harald Nordgren" <haraldnordgren@gmail.com>,
"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: Re: [PATCH v2] status: reword message for a missing upstream branch
Date: Thu, 19 Nov 2026 08:41:37 -0800 [thread overview]
Message-ID: <xmqqik1szsce.fsf@gitster.g> (raw)
In-Reply-To: <20261119055026.759205-1-gitter.spiros@gmail.com> (Elia Pinto's message of "Thu, 19 Nov 2026 06:50:26 +0100")
Elia Pinto <gitter.spiros@gmail.com> writes:
> 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.
>> 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.
next prev parent reply other threads:[~2026-11-19 16:41 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-19 17:57 [PATCH] status: reword message for a missing upstream branch Elia Pinto
2026-10-19 18:04 ` Harald Nordgren
2026-10-19 21:42 ` Junio C Hamano
2026-10-20 7:29 ` Elia Pinto
2026-10-21 7:21 ` [PATCH v2] " Elia Pinto
2026-10-30 9:05 ` Elia Pinto
2026-11-17 21:27 ` Elia Pinto
2026-11-17 22:03 ` Harald Nordgren
2026-11-17 23:29 ` Junio C Hamano
2026-11-18 15:51 ` Junio C Hamano
2026-11-19 5:50 ` Elia Pinto
2026-11-19 16:41 ` Junio C Hamano [this message]
2026-11-19 5:57 ` [PATCH v3] " Elia Pinto
2026-11-19 18:05 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqik1szsce.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitter.spiros@gmail.com \
--cc=haraldnordgren@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox