public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Jeff King <peff@peff•net>
Cc: Karthik Nayak <karthik.188@gmail•com>,  git@vger•kernel.org
Subject: Re: [PATCH v2] builtin/push: call set_refspecs after validating remote
Date: Tue, 09 Jul 2024 18:04:00 -0700	[thread overview]
Message-ID: <xmqqbk369hxb.fsf@gitster.g> (raw)
In-Reply-To: <20240709235507.GB1525171@coredump.intra.peff.net> (Jeff King's message of "Tue, 9 Jul 2024 19:55:07 -0400")

Jeff King <peff@peff•net> writes:

> On Tue, Jul 09, 2024 at 11:44:25AM -0700, Junio C Hamano wrote:
>
>> In any case, an obvious additional fix on top of your change might
>> be to do something like this:
>> 
>>         diff --git i/remote.c w/remote.c
>>         index 5fa046c8f8..d7f9ba3571 100644
>>         --- i/remote.c
>>         +++ w/remote.c
>>         @@ -682,7 +682,7 @@ remotes_remote_get_1(
>>                 struct remote *ret;
>>                 int name_given = 0;
>> 
>>         -	if (name)
>>         +	if (name && *name)
>>                         name_given = 1;
>>                 else
>>                         name = get_default(remote_state, remote_state->current_branch,
>> 
>> which would give us the default remote name, and we would not call
>> add_url_alias() with a bogus empty string to nuke the list.
>
> FWIW, I almost suggested something like this earlier. The outcome will
> be the same (remote_get(), etc, will return NULL), but I think it
> removes the "this is surprising" comment from my earlier email and makes
> things much more explicit.
>
> (I also agree with everything else you said in your review).

Heh, thanks.  I should prepare to shoot myself then ;-)

  reply	other threads:[~2024-07-10  1:04 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-08 14:03 [PATCH] builtin/push: call set_refspecs after validating remote Karthik Nayak
2024-07-08 19:17 ` Junio C Hamano
2024-07-08 23:33   ` Jeff King
2024-07-09  9:59   ` Karthik Nayak
2024-07-08 23:32 ` Jeff King
2024-07-09  9:05   ` Karthik Nayak
2024-07-09  9:59     ` Jeff King
2024-07-09 14:49 ` [PATCH v2] " Karthik Nayak
2024-07-09 18:44   ` Junio C Hamano
2024-07-09 18:56     ` Junio C Hamano
2024-07-09 23:55     ` Jeff King
2024-07-10  1:04       ` Junio C Hamano [this message]
2024-07-10 13:12     ` Karthik Nayak
2024-07-10 15:34       ` Junio C Hamano
2024-07-10 15:46       ` Jeff King
2024-07-11  9:35         ` Karthik Nayak
2024-07-11 21:32           ` Jeff King
2024-07-11  9:39   ` [PATCH v3] " Karthik Nayak
2024-07-11 15:08     ` Junio C Hamano
2024-07-11 21:33       ` Jeff King

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=xmqqbk369hxb.fsf@gitster.g \
    --to=gitster@pobox$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=karthik.188@gmail$(echo .)com \
    --cc=peff@peff$(echo .)net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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