threads / discuss / 15018

Issues when changing submodule URLs

Subject: Issues when changing submodule URLs

## tl;dr

2 messages between Aug 15, 2008 and Aug 15, 2008.

replies: 1people: 2as markdown or json

Gerard Lledó· Aug 15, 2008, 12:37 UTC · lore

We are using a super repository for our development where all our code resides inside submodules. I'm maintaining this tree, so it's quite common that I change a submodule to point to a different URL according to our needs (ie, another developer is now in charge of one module).

So, basically I delete the old submodule "rm -rf module && git rm module", tune .gitmodules and add it again from a different location "git submodule add ssh://server/newpath module".

The problem comes when another developer pulls the super repository from me and he already has the old module URL initialized/updated. What is a safe/obvious update path for him? "git submodule update" does not work and running init/update doesn't help neither. Is there any way for me to ease these tasks for the rest of developers?

I know one option is to keep the URLs untouched and then merge trees as needed, but this seems to be a bigger workload for everyone.

BR, Gerard

PS: Please CC me, as I'm not registered to the list.
Michael J Gruber· Aug 15, 2008, 15:01 UTC · re: Gerard Lledó · lore

Re: Issues when changing submodule URLs

Gerard Lledó venit, vidit, dixit 15.08.2008 14:37:
Show 17 quoted lines
> We are using a super repository for our development where all our code
> resides inside submodules. I'm maintaining this tree, so it's quite
> common that I change a submodule to point to a different URL according
> to our needs (ie, another developer is now in charge of one module).
> 
> So, basically I delete the old submodule "rm -rf module && git rm
> module", tune .gitmodules and add it again from a different location
> "git submodule add ssh://server/newpath module".
> 
> The problem comes when another developer pulls the super repository
> from me and he already has the old module URL initialized/updated.
> What is a safe/obvious update path for him? "git submodule update"
> does not work and running init/update doesn't help neither.
> Is there any way for me to ease these tasks for the rest of developers?
> 
> I know one option is to keep the URLs untouched and then merge trees
> as needed, but this seems to be a bigger workload for everyone.
How about:
- You mirror the submodule repos.
- Your superproject references the mirrors.
- In your mirror configuration, use descriptive names rather than actual 
URLs for the origin of the mirror.
- Use "url.realurl.insteadOf descriptivename" in your own config, which 
can be changed easily whenever the authoritative source of a submodule 
changes (see git config).

Cheers, Michael

← back to recent threads