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

Re: What's cooking in git.git (Apr 2020, #01; Wed, 15)

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 17, 2020, 23:22 UTC
Message-ID
<xmqq8sitvgtd.fsf@gitster.c.googlers.com>
In-Reply-To
<20200417220445.sasjy4rvzonoz7cn@doriath>
Damien Robert <damien.olivier.robert@gmail.com> writes:
Show 6 quoted lines
> 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.
Previous: Damien RobertNext: Damien Robert
Message 13 of 18 in “What's cooking in git.git (Apr 2020, #01; Wed, 15)”
  1. Junio C HamanoApr 15, 2020
  2. Elijah NewrenApr 16, 2020
  3. Junio C HamanoApr 16, 2020
  4. Damien RobertApr 16, 2020
  5. Jeff KingApr 16, 2020
  6. Junio C HamanoApr 16, 2020
  7. Damien RobertApr 16, 2020
  8. Damien RobertApr 16, 2020
  9. Junio C HamanoApr 16, 2020
  10. Damien RobertApr 17, 2020
  11. Junio C HamanoApr 17, 2020
  12. Damien RobertApr 17, 2020
  13. Junio C HamanoApr 17, 2020
  14. Damien RobertApr 18, 2020
  15. Danh DoanApr 17, 2020
  16. Junio C HamanoApr 17, 2020
  17. Danh DoanApr 17, 2020
  18. Junio C HamanoApr 17, 2020

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.