{"thread":{"id":"28678","subject":"Bug? url.insteadOf overwrites remote.pushUrl","startedAt":"2011-10-14T13:55:40Z","lastAt":"2011-10-14T19:16:41Z","messageCount":3,"participants":["Kirill Likhodedov","Michael J Gruber"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"177645","messageId":"CAB6D58F-A3C9-4532-A9CC-10E43CD34E4E@jetbrains.com","threadId":"28678","inReplyTo":null,"subject":"Bug? url.insteadOf overwrites remote.pushUrl","fromName":"Kirill Likhodedov","fromEmail":"kirill.likhodedov@jetbrains.com","sentAt":"2011-10-14T13:55:40Z","receivedAt":"2011-10-14T13:55:40Z","isPatch":false,"sender":{"key":"kirill.likhodedov@jetbrains.com","avatar":"https://gravatar.com/avatar/9fd55d2a110e8e96deb3ed7b503d7f3b9b5b1ed5ca9ef6683c15525b11b94e63?d=mp&s=160"},"body":"\nI've found that defining url.<base>.insteadOf overrides explicit remote.<name>.pushUrl.\nOn the other hand, pushInsteadOf doesn't override explicit pushUrl.\nIs it a bug?\n\n# cat .git/config\n[remote \"origin\"]\n\tfetch = +refs/heads/*:refs/remotes/origin/*\n\turl = github.com/klikh/Test.git \n\tpushUrl = jetbrains.com/klikh/Test.git \n[url \"http://\"]\n  insteadOf=jet\n\n# git remote -v\norigin\tgithub.com/klikh/Test.git (fetch)\norigin\thttp://brains.com/klikh/Test.git (push)\n\n\nSee also http://kerneltrap.org/mailarchive/git/2009/9/7/11264/thread - patch introducing pushInsteadOf & discussion \n\n----------------------------------\nKirill Likhodedov\nJetBrains, Inc\nhttp://www.jetbrains.com\n\"Develop with pleasure!\"\n"},{"id":"177652","messageId":"4E9856BD.3010807@drmicha.warpmail.net","threadId":"28678","inReplyTo":"CAB6D58F-A3C9-4532-A9CC-10E43CD34E4E@jetbrains.com","subject":"Re: Bug? url.insteadOf overwrites remote.pushUrl","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2011-10-14T15:35:25Z","receivedAt":"2011-10-14T15:35:25Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Kirill Likhodedov venit, vidit, dixit 14.10.2011 15:55:\n> \n> I've found that defining url.<base>.insteadOf overrides explicit\n> remote.<name>.pushUrl.\n\nIt doesn't really override it. It is applied to it, i.e. transforms it.\n\n> On the other hand, pushInsteadOf doesn't\n> override explicit pushUrl. Is it a bug?\n\nThat is as described in the thread (thanks for linking to it).\n\n> # cat .git/config [remote \"origin\"] fetch =\n> +refs/heads/*:refs/remotes/origin/* url = github.com/klikh/Test.git \n> pushUrl = jetbrains.com/klikh/Test.git [url \"http://\"] insteadOf=jet\n> \n> # git remote -v origin\tgithub.com/klikh/Test.git (fetch) origin\n> http://brains.com/klikh/Test.git (push)\n\nThe idea of \"pushInsteadOf\" was that, instead of having to define url\nand pushurl separately, you can use different rules, say\n\ngithub -> git://github.com (fetch)\ngithub -> https://username@github.com (push)\ngithub/ -> git@github.com: (push)\n\nused with \"url = github/otheruser/repo.git\" alone, without pushurl.\n\npushurl predates pushinsteadof, and when the latter was introduced, one\ncould have argued for or against \"insteadof\" being applied to pushurls.\nBut that was necessary before, and existing behavior at the time when\npushinsteadof was introduced. So, I don't see a bug, nor anything we\ncould change now, though arguably most people use either pushinstead of\nor pushurl, but not both.\n\nCheers,\nMichael\n"},{"id":"177668","messageId":"0656F8BA-3B41-473D-88A6-6A703C9A9CED@jetbrains.com","threadId":"28678","inReplyTo":"4E9856BD.3010807@drmicha.warpmail.net","subject":"Re: Bug? url.insteadOf overwrites remote.pushUrl","fromName":"Kirill Likhodedov","fromEmail":"kirill.likhodedov@jetbrains.com","sentAt":"2011-10-14T19:16:41Z","receivedAt":"2011-10-14T19:16:41Z","isPatch":false,"sender":{"key":"kirill.likhodedov@jetbrains.com","avatar":"https://gravatar.com/avatar/9fd55d2a110e8e96deb3ed7b503d7f3b9b5b1ed5ca9ef6683c15525b11b94e63?d=mp&s=160"},"body":">> On the other hand, pushInsteadOf doesn't\n>> override explicit pushUrl. Is it a bug?\n> \n> That is as described in the thread (thanks for linking to it).\n\n> pushurl predates pushinsteadof, and when the latter was introduced, one\n> could have argued for or against \"insteadof\" being applied to pushurls.\n> But that was necessary before, and existing behavior at the time when\n> pushinsteadof was introduced. So, I don't see a bug, nor anything we\n> could change now, though arguably most people use either pushinstead of\n> or pushurl, but not both.\n\n\nYeah, that's clear now. As I already answered to Junio in another thread, my question was only about insteadOf, not pushInsteadOf behavior. \nThe behavior of pushInsteadOf is completely clear from the thread and from t5516-fetch-push.sh\nSorry for making it not clear enough. \n\nAnyway, 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.\n"}]}