Re: [RFC] [PATCH] remote: add new --fetch option for set-url

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [RFC] [PATCH] remote: add new --fetch option for set-url

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:03:06

Jeff King [off-list ref] writes:
However, I think what removed the confusion for me in your --only=both
proposal was the presence of a "both" option, since it made it more
clear that is not what no-option means. So what about just "--push",
"--fetch", and "--both"?
I think that is the set that is most sensible, at least
syntactically, among the ones I heard so far in this thread.

However, one thing still makes me wonder....

After doing "set-url --fetch" and nothing else, because the user
never said "--both" or "--push", does the user get a configuration
where "git push" fails?  Or does "set-url --fetch" still gives us
remote.nick.url and causes "git push" to also go there?

If that is the case, then did addition of "--fetch" achieve anything
to reduce confusion?

After doing "set-url --push" and nothing else, I suspect that having
remote.nick.pushURL alone without remote.nick.URL will make "git fetch"
to fail, which would be in line with my expectation.  I just expected
anything we do in the name of symmetry or consistency would work the
same/symmetric way, I cannot see how "set-url --fetch" would work to
make its effect symmetric to the "set-url --push" one.

Puzzled...

Re: [RFC] [PATCH] remote: add new --fetch option for set-url

From: Jeff King <hidden>
Date: 2016-06-15 23:03:06

On Mon, Nov 24, 2014 at 08:55:13PM -0800, Junio C Hamano wrote:
Jeff King [off-list ref] writes:
quoted
However, I think what removed the confusion for me in your --only=both
proposal was the presence of a "both" option, since it made it more
clear that is not what no-option means. So what about just "--push",
"--fetch", and "--both"?
I think that is the set that is most sensible, at least
syntactically, among the ones I heard so far in this thread.

However, one thing still makes me wonder....

After doing "set-url --fetch" and nothing else, because the user
never said "--both" or "--push", does the user get a configuration
where "git push" fails?  Or does "set-url --fetch" still gives us
remote.nick.url and causes "git push" to also go there?
I think the latter. And that makes sense to me. Push falls back to fetch
at runtime. And you never set a push url, so that's what happens.

But it is not symmetric. We do not fall back fetch to push. We _could_,
but that is a separate issue (one for git-fetch, and not git-remote).
And I do not think it is one anybody is particularly asking for.

We could also stop making push fall back to fetch. But I think people
would find that irritating.

I dunno. I think there has always been an implicit "subordinate"
relationship between fetch and push URLs, with fetch being the "main"
one. Maybe that is so ingrained in me at this point that I do not see a
problem with the asymmetry.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help