{"thread":{"id":"28674","subject":"url.<base>.insteadOf with empty value","startedAt":"2011-10-14T09:03:53Z","lastAt":"2011-10-14T19:09:55Z","messageCount":3,"participants":["Kirill Likhodedov","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"177628","messageId":"54556728-92C0-4992-9831-0D582C383235@jetbrains.com","threadId":"28674","inReplyTo":null,"subject":"url.<base>.insteadOf with empty value","fromName":"Kirill Likhodedov","fromEmail":"kirill.likhodedov@jetbrains.com","sentAt":"2011-10-14T09:03:53Z","receivedAt":"2011-10-14T09:03:53Z","isPatch":false,"sender":{"key":"kirill.likhodedov@jetbrains.com","avatar":"https://gravatar.com/avatar/9fd55d2a110e8e96deb3ed7b503d7f3b9b5b1ed5ca9ef6683c15525b11b94e63?d=mp&s=160"},"body":"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\n\nProbably that's because any url starts with empty string and thus has to be substituted. \nBut 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.\n\nPlease check if current Git behavior is correct. \n\nIf it is not a bug, I'd suggest to add a note to man git-config about this.\n\n# git version\ngit version 1.7.6\n\n# cat .git/config\n[remote \"origin\"]\n  fetch = +refs/heads/*:refs/remotes/origin/*\n  url = github.com/klikh/Test.git \n  pushUrl = jetbrains.com/klikh/Test.git \n[url \"http://\"]\n  insteadOf=\n\n# git remote -v\norigin\thttp://github.com/klikh/Test.git (fetch)\norigin\thttp://jetbrains.com/klikh/Test.git (push)\n\n\n\n\n----------------------------------\nKirill Likhodedov\nJetBrains, Inc\nhttp://www.jetbrains.com\n\"Develop with pleasure!\"\n"},{"id":"177657","messageId":"7v8von1mnd.fsf@alter.siamese.dyndns.org","threadId":"28674","inReplyTo":"54556728-92C0-4992-9831-0D582C383235@jetbrains.com","subject":"Re: url.<base>.insteadOf with empty value","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-10-14T17:57:42Z","receivedAt":"2011-10-14T17:57:42Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Kirill Likhodedov <Kirill.Likhodedov@jetbrains.com> writes:\n\n> 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\n>\n> Probably that's because any url starts with empty string and thus has to be substituted. \n> 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.\n>\n> Please check if current Git behavior is correct. \n>\n> If it is not a bug, I'd suggest to add a note to man git-config about this.\n\nPlease assume that what the documentation says is clear enough for whoever\nwrote it and need no further clarification, so you would need to help them\nunderstand what additional things you may want the documentation to say,\nby clarifying \"add a note\" and \"about this\" a bit.\n\nThe \"insteadOf\" replacement is meant to apply for any URL we use. I would\nbe surprised if it did not affect pushURL; it would be a bug if it didn't.\n\nOn the other hand, the rewrite done by \"pushinsteadof\" is meant to apply\nonly when remote.<any>.url is used for pushing.  See t/t5516-fetch-push.sh\npart of the patch for 1c2eafb (Add url.<base>.pushInsteadOf: URL rewriting\nfor push only, 2009-09-07). It would clarify what the intended interaction\namong these configuration variables.\n\nThanks.\n"},{"id":"177667","messageId":"6DA2F444-C774-4F22-8EF0-BFD8F3308A4A@jetbrains.com","threadId":"28674","inReplyTo":"7v8von1mnd.fsf@alter.siamese.dyndns.org","subject":"Re: url.<base>.insteadOf with empty value","fromName":"Kirill Likhodedov","fromEmail":"kirill.likhodedov@jetbrains.com","sentAt":"2011-10-14T19:09:55Z","receivedAt":"2011-10-14T19:09:55Z","isPatch":false,"sender":{"key":"kirill.likhodedov@jetbrains.com","avatar":"https://gravatar.com/avatar/9fd55d2a110e8e96deb3ed7b503d7f3b9b5b1ed5ca9ef6683c15525b11b94e63?d=mp&s=160"},"body":"\n14.10.2011, в 21:57, Junio C Hamano writes:\n\n>> 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\n>> \n>> If it is not a bug, I'd suggest to add a note to man git-config about this.\n> \n> Please assume that what the documentation says is clear enough for whoever\n> wrote it and need no further clarification, so you would need to help them\n> understand what additional things you may want the documentation to say,\n> by clarifying \"add a note\" and \"about this\" a bit.\n\nI would add the following to the \"url.<base>.insteadOf\" section of git-config:\n:::: If empty value is specified in insteadOf, <base> will be added to the start of any URL.\n\n\n> The \"insteadOf\" replacement is meant to apply for any URL we use. I would\n> be surprised if it did not affect pushURL; it would be a bug if it didn't.\n\nThat was the question I wanted to clarify. \nI thought that pushURL shouldn't be affected by insteadOf, because it is not affected by pushInsteadOf.\nThanks for clarifying that out.\n\n> On the other hand, the rewrite done by \"pushinsteadof\" is meant to apply\n> only when remote.<any>.url is used for pushing.  See t/t5516-fetch-push.sh\n> part of the patch for 1c2eafb (Add url.<base>.pushInsteadOf: URL rewriting\n> for push only, 2009-09-07). It would clarify what the intended interaction\n> among these configuration variables.\n\n\nYeah, 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\n\nThanks."}]}