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

git submodules and commit

From
Nigel Magnay <nigel.magnay@gmail.com>
Date
Jul 16, 2008, 10:32 UTC
Message-ID
<320075ff0807160332k5e49c256tb4191de628ecf41c@mail.gmail.com>
In-Reply-To
<320075ff0807160331j30e8f832m4de3e3bbe9c26801@mail.gmail.com>

I wonder if this is a fairly common pattern. We tend to have modules as git repositories, and projects that tie together those git repositories as submodules. In general, > 90% of the work is done in one module, and the following stanza gets used a lot:

cd /proj/modA git commit -s -m "Some change" git push

cd .. git add modA git commit -s -m "Some change (modA)" git push

But since this is much more cumbersome than (say) "svn ci", what often happens is developers just commit into modA, then carry on. Or for people just learning git, they somtimes screw up, and push the parent proj but not the child modA

This is a shame, as it means any external people pulling updates directly from proj will not get this change (e.g. CI tools speculatively compiling against every developer tree).

For me, in some really high proportion of cases, I think I want 'git commit' to mean 'commit to any child repositories, any sibling repositories, and any parent repositories (updating the submodule sha1 as appropriate). In other words, 'pretend like the whole thing is one big repo'.

I guess it probably gets sticky when there are merge conflicts. Is anyone working on this kind of thing; I might be able to give some time to help work on it?

Next: Johannes Sixt
Message 1 of 14 in “git submodules and commit”
  1. Nigel MagnayJul 16, 2008
  2. Johannes SixtJul 16, 2008
  3. Nigel MagnayJul 16, 2008
  4. Johannes SixtJul 16, 2008
  5. Petr BaudisJul 16, 2008
  6. Nigel MagnayJul 16, 2008
  7. Johannes SixtJul 16, 2008
  8. Nigel MagnayJul 16, 2008
  9. Petr BaudisJul 16, 2008
  10. Nigel MagnayJul 16, 2008
  11. Avery PennarunJul 16, 2008
  12. Nigel MagnayJul 17, 2008
  13. Avery PennarunJul 17, 2008
  14. Ping YinJul 18, 2008

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.