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

Re: Feature Request: Branch-Aware Submodules

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 25, 2016, 17:46 UTC
Message-ID
<xmqqvayon3md.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<7B5AD16B-9729-453E-839C-2A2FDB07F8E9@student.ethz.ch>
"Hedges  Alexander" <ahedges@student.ethz.ch> writes:
> Right now updating a submodule in a topic branch and merging it into master
> will not change the submodule index in master leading to at least two commit
> for the same change (one in any active branch).
I stopped reading here because I am not getting this.

I guess I am confused because I do not understand what you mean by "the submodule index in master". The concept of "index" does not belong to each branch (or even a commit), so by "index" you are trying to point at something else, but I cannot guess what it is.

You have a top-level superproject that has another project as its submodule. The superproject has topic and master branches (or it may only have master). The project that is used as its submodule also has topic and master branches (it may have more). You do your development in the submodule, e.g.

    cd submoduledir
    git checkout topic
    hack hack hack
    git commit
    git checkout master
    git merge topic

and merge the topic branch into its master when the topic is polished enough.

And then? The 'master' in the submodule is good enough, so you'd go back to the top-level superproject and bind that merged result in its place? e.g.

    cd ..
    git add submoduledir
    git commit -m "Updated submoduledir with the topic"

That is only one commit each in the superproject and the submodule project.

Previous: Junio C Hamano
Message 6 of 6 in “Feature Request: Branch-Aware Submodules”
  1. Hedges AlexanderAug 25, 2016
  2. Stefan BellerAug 25, 2016
  3. Junio C HamanoAug 25, 2016
  4. Stefan BellerAug 25, 2016
  5. Junio C HamanoAug 25, 2016
  6. Junio C HamanoAug 25, 2016

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.