Subject: Re: [PATCH] Teach git submodule update to use distributed repositories

From: Mark Levedahl <[email-masked]>
Date: Fri, 18 Jul 2008 18:38:27 -0400

Petr Baudis wrote:
> On Fri, Jul 18, 2008 at 04:09:40PM +0100, Nigel Magnay wrote:
> 
> In that case you would need the "URL mappings", perhaps as a per-remote
> attribute. That is, you could configure:
> 
> 	"When I am doing git pull fred, do git submodule update but
> 	apply remote.fred.subrewrite sed script on each URL before
> 	fetching the submodule."
> 
> Still, that feels quite hackish to me, and I'm not convinced that your
> workflow cannot be adjusted so that users merge only the next-to-last
> commit of a branch instead of the last one.
> 

There really are two distinct forms of submodule URL's supported by 
git-submodule: absolute and relative. The first says "always go to repository x 
on server y", and is the correct form for a *very* loosely coupled submodule. 
However, it requires a lot of hacking to support fetching from an alternate 
location.

The relative form says "go to this location *relative* to the superproject's 
repository". Using this form greatly eases the use case. Basically, fred has his 
tree of trees on his system, arranged exactly as they are on the main server. If 
you do a git fetch "fred" into superproject, then submodule update, submodule 
should be able to find the related submdodules on "fred" and get the data 
relatively easily.

I actually submitted a patch series a while back that does this, but no-one on 
the list cared for the use case it supported so that series died.

Mark