git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Damien Robert <damien.olivier.robert@gmail.com>
Cc: Jeff King <peff@peff.net>, git@vger.kernel.org
Subject: Re: What's cooking in git.git (Apr 2020, #01; Wed, 15)
Date: Fri, 17 Apr 2020 16:22:06 -0700	[thread overview]
Message-ID: <xmqq8sitvgtd.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <20200417220445.sasjy4rvzonoz7cn@doriath> (Damien Robert's message of "Sat, 18 Apr 2020 00:04:45 +0200")

Damien Robert <damien.olivier.robert@gmail.com> writes:

> The difference in remote_get_1 is that
> 	name_given = 1;
> So
> 	if (name_given && !valid_remote(ret))
> 		add_url_alias(ret, name);
> gets called.

Ah, of course ;-) The code in builtin/push.c rely on being able to
pass NULL as the name and rely on current branch getting used; you
have to pass the name of the ref you are trying to format %(push)
for, so you would trigger add_url_alias(), which says as a fallback
that URL for "origin" is "origin" and makes ret->url non-NULL (hence
it no longer is !valid_remote() and gets returned).  

Geez.  This is tricky.

> But I think that means that my fixup is actually wrong when a pushRemote is
> set without a remote while 'origin' do exist.

Thanks.

  reply	other threads:[~2020-04-17 23:22 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-15 23:01 What's cooking in git.git (Apr 2020, #01; Wed, 15) Junio C Hamano
2020-04-16 15:28 ` Elijah Newren
2020-04-16 16:37   ` Junio C Hamano
2020-04-16 21:12 ` Damien Robert
2020-04-16 21:30   ` Jeff King
2020-04-16 22:18     ` Junio C Hamano
2020-04-16 22:47       ` Damien Robert
2020-04-16 23:05         ` Damien Robert
2020-04-16 23:34           ` Junio C Hamano
2020-04-17 12:54             ` Damien Robert
2020-04-17 17:30               ` Junio C Hamano
2020-04-17 22:04                 ` Damien Robert
2020-04-17 23:22                   ` Junio C Hamano [this message]
2020-04-18 17:36                     ` Damien Robert
2020-04-17  2:24 ` Danh Doan
2020-04-17  5:38   ` Junio C Hamano
2020-04-17 13:36     ` Danh Doan
2020-04-17 17:40       ` 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=xmqq8sitvgtd.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=damien.olivier.robert@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /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;
as well as URLs for NNTP newsgroup(s).