* Bug? url.insteadOf overwrites remote.pushUrl
@ 2011-10-14 13:55 Kirill Likhodedov
2011-10-14 15:35 ` Michael J Gruber
0 siblings, 1 reply; 3+ messages in thread
From: Kirill Likhodedov @ 2011-10-14 13:55 UTC (permalink / raw)
To: git
I've found that defining url.<base>.insteadOf overrides explicit remote.<name>.pushUrl.
On the other hand, pushInsteadOf doesn't override explicit pushUrl.
Is it a bug?
# cat .git/config
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = github.com/klikh/Test.git
pushUrl = jetbrains.com/klikh/Test.git
[url "http://"]
insteadOf=jet
# git remote -v
origin github.com/klikh/Test.git (fetch)
origin http://brains.com/klikh/Test.git (push)
See also http://kerneltrap.org/mailarchive/git/2009/9/7/11264/thread - patch introducing pushInsteadOf & discussion
----------------------------------
Kirill Likhodedov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Bug? url.insteadOf overwrites remote.pushUrl
2011-10-14 13:55 Bug? url.insteadOf overwrites remote.pushUrl Kirill Likhodedov
@ 2011-10-14 15:35 ` Michael J Gruber
2011-10-14 19:16 ` Kirill Likhodedov
0 siblings, 1 reply; 3+ messages in thread
From: Michael J Gruber @ 2011-10-14 15:35 UTC (permalink / raw)
To: Kirill Likhodedov; +Cc: git
Kirill Likhodedov venit, vidit, dixit 14.10.2011 15:55:
>
> I've found that defining url.<base>.insteadOf overrides explicit
> remote.<name>.pushUrl.
It doesn't really override it. It is applied to it, i.e. transforms it.
> On the other hand, pushInsteadOf doesn't
> override explicit pushUrl. Is it a bug?
That is as described in the thread (thanks for linking to it).
> # cat .git/config [remote "origin"] fetch =
> +refs/heads/*:refs/remotes/origin/* url = github.com/klikh/Test.git
> pushUrl = jetbrains.com/klikh/Test.git [url "http://"] insteadOf=jet
>
> # git remote -v origin github.com/klikh/Test.git (fetch) origin
> http://brains.com/klikh/Test.git (push)
The idea of "pushInsteadOf" was that, instead of having to define url
and pushurl separately, you can use different rules, say
github -> git://github.com (fetch)
github -> https://username@github.com (push)
github/ -> git@github.com: (push)
used with "url = github/otheruser/repo.git" alone, without pushurl.
pushurl predates pushinsteadof, and when the latter was introduced, one
could have argued for or against "insteadof" being applied to pushurls.
But that was necessary before, and existing behavior at the time when
pushinsteadof was introduced. So, I don't see a bug, nor anything we
could change now, though arguably most people use either pushinstead of
or pushurl, but not both.
Cheers,
Michael
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Bug? url.insteadOf overwrites remote.pushUrl
2011-10-14 15:35 ` Michael J Gruber
@ 2011-10-14 19:16 ` Kirill Likhodedov
0 siblings, 0 replies; 3+ messages in thread
From: Kirill Likhodedov @ 2011-10-14 19:16 UTC (permalink / raw)
To: Michael J Gruber; +Cc: git
>> On the other hand, pushInsteadOf doesn't
>> override explicit pushUrl. Is it a bug?
>
> That is as described in the thread (thanks for linking to it).
> pushurl predates pushinsteadof, and when the latter was introduced, one
> could have argued for or against "insteadof" being applied to pushurls.
> But that was necessary before, and existing behavior at the time when
> pushinsteadof was introduced. So, I don't see a bug, nor anything we
> could change now, though arguably most people use either pushinstead of
> or pushurl, but not both.
Yeah, that's clear now. As I already answered to Junio in another thread, my question was only about insteadOf, not pushInsteadOf behavior.
The behavior of pushInsteadOf is completely clear from the thread and from t5516-fetch-push.sh
Sorry for making it not clear enough.
Anyway, thanks for giving a one more explanation and example on how url, pushUrl and insteadOf configs work, it is always useful to go though it once again.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-10-14 19:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-14 13:55 Bug? url.insteadOf overwrites remote.pushUrl Kirill Likhodedov
2011-10-14 15:35 ` Michael J Gruber
2011-10-14 19:16 ` Kirill Likhodedov
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).