{"thread":{"id":"32270","subject":"Git problem with CIFS/SAMBA URLs","startedAt":"2012-12-04T20:14:53Z","lastAt":"2012-12-04T20:14:53Z","messageCount":1,"participants":["Nils Fenner"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"204501","messageId":"3A877BE3-35EA-425D-A9B6-AE636E339E39@web.de","threadId":"32270","inReplyTo":null,"subject":"Git problem with CIFS/SAMBA URLs","fromName":"Nils Fenner","fromEmail":"nilsfenner@web.de","sentAt":"2012-12-04T20:14:53Z","receivedAt":"2012-12-04T20:14:53Z","isPatch":false,"sender":{"key":"nilsfenner@web.de","avatar":null},"body":"Hi guys,\n \nI tried to use url.insteadof to get URLs mapped correctly, starting with a double-slash (//). Unfortunately, Git doesn't recognize that and still tries to connect to the original URL. I am using Git in a productive environment. On Windows desktops, MsysGit 1.7.11 and 1.8.0. On ubuntu clients Git 1.7.9.0 (as delivered with the distro).\n\nProblem is, that we have lots and lots of submodules, with URLs like //thegitserver/.../therepo.git. Now I'd like to checkout on the Ubuntu machine for the CI system. Should not be much of a preblem - well, in theory.\n\nLet's replace the windows url's (//someserver/repo.git) with a mounted CIFS path (/media/samba_share/repo.git). On MsysGit this works as long as the server is reachable. On Ubuntu it completely doesn't work. All comes down to the url-alias, which seems not to be replaced correctly when using windows double-slash url's.\n \nI'd like to give some more samples to show what's happening:\n \nTo access cross-plattform file systems I mounted the windows share via samba (e.g. on /media/samba_share). This works fine and we are able to clone the main repositories by using:\n$ git clone /media/samba_share/repo.git\n \nNow let's get the submodules:\n$ git submodule init -> writes the \"wrong\" //thegitserver/... URLs in the config.\n$ git submodule update -> fails because of the CIFS double-slash url's.\n\nWhat to do? Simply define a \"url.insteadof\" alias\n[url \"/media/samba_share\"]\n    insteadof = //thegitserver\n\nUh, oh. Doesn't help.\n \nThe following would work like expected, but is not usable for my case. I would have to rewrite all URLs, what I don't want to do (maybe in the future):\n[url \"/media/samba_share\"]\n  insteadof = file:////serverurl\n \nOn MsysGit, replacing the double-slash works, as long as the URL is reachable (meaning the server has to be online). Otherwise it behaves the same like Linux.\n \nSample error Message:\nfatal: repository '//thegitserver/.../repository.git' does not exist\n \nThe URL should be: /media/samba_share/.../repository.git\n \nThis seems to be the only case. Other URLs work like expected.\n\nSeems like this is a bug in Git. Or did I miss something?\n\nPlease help!\n\nCheers,\nNils\n"}]}