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

Re: Submodules and merge conflicts

From
Avery Pennarun <apenwarr@gmail.com>
Date
May 21, 2009, 20:31 UTC
Message-ID
<32541b130905211331u47be06afrcff2e01f0c666680@mail.gmail.com>
In-Reply-To
<1242912120853-2951928.post@n2.nabble.com>
On Thu, May 21, 2009 at 9:22 AM, Henk <henk_westhuis@hotmail.com> wrote:
Show 7 quoted lines
> Instead of using the sha1 of a specific revision in the submodule, I would
> find it more logical to use a branch-name or tag. This way you can commit on
> the submodule without having to commit the new submodule revision to the
> main repository also.
>
> I would like to hear your thoughts on this. Maybe we are using submodules
> wrong, or maybe this is already possible.

The primary advantage of the git submodule code is the ability to lock to a specific sha1. If you don't want to do that, you're not going to get much benefit from using submodules.

One option here is to simply skip the 'git submodule' altogether and just have a script that checks out the other git repositories into subdirs. Then you have total control over which branches, etc are included, the changes to the script (eg. to change which branch you want to use) can be merged just like changes to anything else.

We do something in between on our internal projects: we use git submodules to lock in the sha-1 (it's really valuable to know *exactly* which version of everything was used in a particular release), but we have scripts to auto-update the sha-1 for each submodule to the tip of the right branches.

For some other projects, we also use the git-subtree tool I developed (http://alumnit.ca/~apenwarr/log/?m=200904#30) but given that your submodules are huge things like the Linux kernel, it's probably not appropriate in your case. You might want to look at it anyway in case I'm wrong.

Have fun,
Avery
Previous: Henk
Message 2 of 2 in “Submodules and merge conflicts”
  1. HenkMay 21, 2009
  2. Avery PennarunMay 21, 2009

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.