* url.<base>.insteadOf with empty value
@ 2011-10-14 9:03 Kirill Likhodedov
2011-10-14 17:57 ` Junio C Hamano
0 siblings, 1 reply; 3+ messages in thread
From: Kirill Likhodedov @ 2011-10-14 9:03 UTC (permalink / raw)
To: git
If I don't specify any value for url.<base>.insteadOf or url.<base>.pushInsteadOf, Git substitutes all urls for remotes defined in .git/config
Probably that's because any url starts with empty string and thus has to be substituted.
But it might be a bit confusing, because on the other hand if no value is given to the property insteadOf, user may expect this property to be ignored.
Please check if current Git behavior is correct.
If it is not a bug, I'd suggest to add a note to man git-config about this.
# git version
git version 1.7.6
# 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=
# git remote -v
origin http://github.com/klikh/Test.git (fetch)
origin http://jetbrains.com/klikh/Test.git (push)
----------------------------------
Kirill Likhodedov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: url.<base>.insteadOf with empty value
2011-10-14 9:03 url.<base>.insteadOf with empty value Kirill Likhodedov
@ 2011-10-14 17:57 ` Junio C Hamano
2011-10-14 19:09 ` Kirill Likhodedov
0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2011-10-14 17:57 UTC (permalink / raw)
To: Kirill Likhodedov; +Cc: git, Josh Triplett
Kirill Likhodedov <Kirill.Likhodedov@jetbrains.com> writes:
> If I don't specify any value for url.<base>.insteadOf or url.<base>.pushInsteadOf, Git substitutes all urls for remotes defined in .git/config
>
> Probably that's because any url starts with empty string and thus has to be substituted.
> But it might be a bit confusing, because on the other hand if no value is given to the property insteadOf, user may expect this property to be ignored.
>
> Please check if current Git behavior is correct.
>
> If it is not a bug, I'd suggest to add a note to man git-config about this.
Please assume that what the documentation says is clear enough for whoever
wrote it and need no further clarification, so you would need to help them
understand what additional things you may want the documentation to say,
by clarifying "add a note" and "about this" a bit.
The "insteadOf" replacement is meant to apply for any URL we use. I would
be surprised if it did not affect pushURL; it would be a bug if it didn't.
On the other hand, the rewrite done by "pushinsteadof" is meant to apply
only when remote.<any>.url is used for pushing. See t/t5516-fetch-push.sh
part of the patch for 1c2eafb (Add url.<base>.pushInsteadOf: URL rewriting
for push only, 2009-09-07). It would clarify what the intended interaction
among these configuration variables.
Thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: url.<base>.insteadOf with empty value
2011-10-14 17:57 ` Junio C Hamano
@ 2011-10-14 19:09 ` Kirill Likhodedov
0 siblings, 0 replies; 3+ messages in thread
From: Kirill Likhodedov @ 2011-10-14 19:09 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Josh Triplett
14.10.2011, в 21:57, Junio C Hamano writes:
>> If I don't specify any value for url.<base>.insteadOf or url.<base>.pushInsteadOf, Git substitutes all urls for remotes defined in .git/config
>>
>> If it is not a bug, I'd suggest to add a note to man git-config about this.
>
> Please assume that what the documentation says is clear enough for whoever
> wrote it and need no further clarification, so you would need to help them
> understand what additional things you may want the documentation to say,
> by clarifying "add a note" and "about this" a bit.
I would add the following to the "url.<base>.insteadOf" section of git-config:
:::: If empty value is specified in insteadOf, <base> will be added to the start of any URL.
> The "insteadOf" replacement is meant to apply for any URL we use. I would
> be surprised if it did not affect pushURL; it would be a bug if it didn't.
That was the question I wanted to clarify.
I thought that pushURL shouldn't be affected by insteadOf, because it is not affected by pushInsteadOf.
Thanks for clarifying that out.
> On the other hand, the rewrite done by "pushinsteadof" is meant to apply
> only when remote.<any>.url is used for pushing. See t/t5516-fetch-push.sh
> part of the patch for 1c2eafb (Add url.<base>.pushInsteadOf: URL rewriting
> for push only, 2009-09-07). It would clarify what the intended interaction
> among these configuration variables.
Yeah, that's clear. My question was only about insteadOf behavior. Sorry for making it not clear enough. The behavior of pushInsteadOf is completely clear from the discussion thread I mentioned and from t5516-fetch-push.sh
Thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-10-14 19:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-14 9:03 url.<base>.insteadOf with empty value Kirill Likhodedov
2011-10-14 17:57 ` Junio C Hamano
2011-10-14 19:09 ` 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).