git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: FW: Query on git submodules

From
Heiko Voigt <hvoigt@hvoigt.net>
Date
Jun 2, 2015, 11:12 UTC
Message-ID
<20150602111219.GA7442@book.hvoigt.net>
In-Reply-To
<4C328B7D13677A4EAF715D0755A6D7EE25C5AD9E@irsmsx110.ger.corp.intel.com>
On Wed, May 27, 2015 at 01:20:11PM +0000, Frawley, Sarah wrote:
Show 14 quoted lines
> Thanks Heiko for getting back to me.
> 
> Correct when I referred to 10+ layers I meant nested repositories
> which make up a large hierarchy.  Some repositories are repeated
> across the hierarchy.  We check-out submodules to tag versions (as
> opposed to master branch).  If we need to roll out a particular change
> across a hierarchy (e.g. 60 repos) then every level in the hierarchy
> needs to pick up new submodule tags.
> 
> The main 2 issues that we see are:
> 
> 1. Enforcement of absolute paths in git submodules - I am currently
> trialing using a pre-commit hook to highlight this issue to users so
> that they can fix their submodule urls to relative paths.

So you mean, enforcement of relative paths. Right? It might be a good idea to put some code in 'git submodule add' that would automatically use a relative path instead of absolute path if it can calculate one from the superproject. I think that would help your users even more as they do not get an error from the pre-commit hook, but just having everything right after doing the add.

If you want to go that route it should not be that much different from the hook, since the submodule subcommand code is all bash.

Show 7 quoted lines
> 2. Slowness Integrating updates to submodule hierarchy -I have been
> looking at ways of automating such a roll out - this can be useful for
> new project setups or for rolling out an update to all repos and
> quickly integrating it into the submodule hierarchy.  The link below
> shows something similar however it checks out a master branch of each
> submodule in its hierarchy.
> https://chrisjean.com/recursively-updating-git-submodules/
How about
	git submodule update --init --recursive

? That should do the same as the script written in that blog post. Or am I missing something?

Cheers Heiko
Previous: Mattias VannergårdNext: Frawley, Sarah
Message 7 of 8 in “Query on git submodules”
  1. Frawley, SarahMay 22, 2015
  2. Heiko VoigtMay 26, 2015
  3. FW: Query on git submodulesFrawley, Sarah, May 27, 2015
  4. Mattias VannergårdJun 2, 2015
  5. Heiko VoigtJun 2, 2015
  6. Mattias VannergårdJun 2, 2015
  7. Heiko VoigtJun 2, 2015
  8. Frawley, SarahJun 2, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.