{"thread":{"id":"15018","subject":"Issues when changing submodule URLs","startedAt":"2008-08-15T12:37:24Z","lastAt":"2008-08-15T15:01:29Z","messageCount":2,"participants":["Gerard Lledó","Michael J Gruber"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"87301","messageId":"d3af73dc0808150537r1f708bct14113943d741e653@mail.gmail.com","threadId":"15018","inReplyTo":null,"subject":"Issues when changing submodule URLs","fromName":"Gerard Lledó","fromEmail":"gerard.lledo@gmail.com","sentAt":"2008-08-15T12:37:24Z","receivedAt":"2008-08-15T12:37:24Z","isPatch":false,"sender":{"key":"gerard.lledo@gmail.com","avatar":null},"body":"We are using a super repository for our development where all our code\nresides inside submodules. I'm maintaining this tree, so it's quite\ncommon that I change a submodule to point to a different URL according\nto our needs (ie, another developer is now in charge of one module).\n\nSo, basically I delete the old submodule \"rm -rf module && git rm\nmodule\", tune .gitmodules and add it again from a different location\n\"git submodule add ssh://server/newpath module\".\n\nThe problem comes when another developer pulls the super repository\nfrom me and he already has the old module URL initialized/updated.\nWhat is a safe/obvious update path for him? \"git submodule update\"\ndoes not work and running init/update doesn't help neither.\nIs there any way for me to ease these tasks for the rest of developers?\n\nI know one option is to keep the URLs untouched and then merge trees\nas needed, but this seems to be a bigger workload for everyone.\n\nBR,\nGerard\n\nPS: Please CC me, as I'm not registered to the list.\n"},{"id":"87316","messageId":"48A59A49.9030305@fastmail.fm","threadId":"15018","inReplyTo":"d3af73dc0808150537r1f708bct14113943d741e653@mail.gmail.com","subject":"Re: Issues when changing submodule URLs","fromName":"Michael J Gruber","fromEmail":"michaeljgruber+gmane@fastmail.fm","sentAt":"2008-08-15T15:01:29Z","receivedAt":"2008-08-15T15:01:29Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Gerard Lledó venit, vidit, dixit 15.08.2008 14:37:\n> We are using a super repository for our development where all our code\n> resides inside submodules. I'm maintaining this tree, so it's quite\n> common that I change a submodule to point to a different URL according\n> to our needs (ie, another developer is now in charge of one module).\n> \n> So, basically I delete the old submodule \"rm -rf module && git rm\n> module\", tune .gitmodules and add it again from a different location\n> \"git submodule add ssh://server/newpath module\".\n> \n> The problem comes when another developer pulls the super repository\n> from me and he already has the old module URL initialized/updated.\n> What is a safe/obvious update path for him? \"git submodule update\"\n> does not work and running init/update doesn't help neither.\n> Is there any way for me to ease these tasks for the rest of developers?\n> \n> I know one option is to keep the URLs untouched and then merge trees\n> as needed, but this seems to be a bigger workload for everyone.\n\nHow about:\n- You mirror the submodule repos.\n- Your superproject references the mirrors.\n- In your mirror configuration, use descriptive names rather than actual \nURLs for the origin of the mirror.\n- Use \"url.realurl.insteadOf descriptivename\" in your own config, which \ncan be changed easily whenever the authoritative source of a submodule \nchanges (see git config).\n\nCheers,\nMichael\n"}]}