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

Re: [PATCH] t5516-fetch-push: Correct misspelled pushInsteadOf

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 4, 2015, 20:14 UTC
Message-ID
<xmqqbnk88qql.fsf@gitster.dls.corp.google.com>
In-Reply-To
<54F6D20D.903@drmicha.warpmail.net>
Michael J Gruber <git@drmicha.warpmail.net> writes:
Show 10 quoted lines
>> I am not sure how the intention of the commit 1c2eafb8 (Add
>> url.<base>.pushInsteadOf: URL rewriting for push only, 2009-09-07),
>> which introduced the behaviour verified by this test, interacts with
>> the desire to redefine what URL and pushURL mean in our recent past,
>> what e.g. e6196ae1 (remote: add --fetch and --both options to set-url,
>> 2014-11-25) wanted to do, though.  Thoughts?
>> 
>
> Wow. That looks strange to me on first read. Sorry I didn't catch it
> back then. "--fetch" sets both url and pushurl??

Yeah, sounds crazy, no? Taken in isolation without consideration around the InsteadOf rewriting, the change sort-of makes sense, though.

But I do not know if the combined whole makes much sense.
Show 19 quoted lines
> So, for definiteness sake, I'll use "url" and "pushurl" for the config
> names and struct members (which the config values end up in), and I'll
> use "URL for fetch" and "URL for push" for the URLs that git will use
> for fetch resp. push.
>
> If there is no "pushurl":
>   "url" will be used as the "URL for fetch" and as the "URL for push".
>   if we are pushing and there is "pushinsteadof" for (part of) "url"
>     subsitute that within "url"
>   else if there is "insteadof" for (part of) "url"
>     substitute that within "url"
>
> If there is a "pushurl":
>   "url" will be used as the "URL for fetch" and "pushurl" as the "URL
> for push".
>   if we are pushing and there is "insteadof" for (part of) "pushurl"
>     substitute that within "pushurl"
>   else if we are fetching and there is "insteadof" for (part of) "url"
>     substiute that within "url"
These make sense to me.
Show 5 quoted lines
> I don't know what "remote set-url" does, I think the whole remote
> command as it is does not fit in well with our UI, but that applies to
> other commands with non-option subcommands as well (or bad). I would
> have hoped it is set-url and set-pushurl to set those two config
> options.

I would have hoped so, too, but I don't use "git remote" myself (as you said, it is an odd man out and there is nothing it and only it can do that is essential for my everyday workflow), so... ;-)

Show 6 quoted lines
> I rarely use pushurl, but could use it to override url, or to do the
> above magic on a case by case level, such as if I need to specify
> different usernames for the same host.
>
> So, that's my understanding of how these things are supposed to work and
> why it is useful.

Yes, I am not questioning the usefulness of insteadof magic. I am wondering if that "--fetch sets both?" breaks the expectation of those who rely on it.

Previous: Michael J Gruber
Message 8 of 8 in “t5516-fetch-push: Correct misspelled pushInsteadOf”
  1. t5516-fetch-push: Correct misspelled pushInsteadOfAnders Kaseorg, Mar 1, 2015
  2. Junio C HamanoMar 2, 2015
  3. Michael J GruberMar 3, 2015
  4. Junio C HamanoMar 3, 2015
  5. Michael J GruberMar 4, 2015
  6. Anders KaseorgMar 4, 2015
  7. Michael J GruberMar 4, 2015
  8. Junio C HamanoMar 4, 2015

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.