All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Michael J Gruber <git@drmicha.warpmail.net>,
	Peter Wu <peter@lekensteyn.nl>
Cc: Anders Kaseorg <andersk@mit.edu>, git@vger.kernel.org
Subject: Re: [PATCH] t5516-fetch-push: Correct misspelled pushInsteadOf
Date: Wed, 04 Mar 2015 12:14:26 -0800	[thread overview]
Message-ID: <xmqqbnk88qql.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <54F6D20D.903@drmicha.warpmail.net> (Michael J. Gruber's message of "Wed, 04 Mar 2015 10:36:13 +0100")

Michael J Gruber <git@drmicha.warpmail.net> writes:

>> 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.

> 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.

> 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... ;-)

> 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.

      parent reply	other threads:[~2015-03-04 20:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-01  4:18 [PATCH] t5516-fetch-push: Correct misspelled pushInsteadOf Anders Kaseorg
2015-03-02 19:43 ` Junio C Hamano
2015-03-03 15:51   ` Michael J Gruber
2015-03-03 20:06     ` Junio C Hamano
2015-03-04  9:36       ` Michael J Gruber
2015-03-04  9:43         ` Anders Kaseorg
2015-03-04 10:10           ` Michael J Gruber
2015-03-04 20:14         ` Junio C Hamano [this message]

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=xmqqbnk88qql.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=andersk@mit.edu \
    --cc=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    --cc=peter@lekensteyn.nl \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.