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 topicand 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.