Re: problem w/recursive, submodules?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



- I'm afraid that we're unable to expose the internal repo because of co. policies.  Other than wrapper scripts for our internal dev. environment, the only thing of note in the internal repo is the .gitmodules file, which consists of the following:

[submodule "staging"]
	path = src
	branch = staging
	url = https://github.com/nyfix/OpenMAMA-omnm.git


- We've found that the problem is avoided if we execute the following command *after* doing the recursive clone.  Not sure why this is necessary -- shouldn't the recursive clone handle that on its own?

git submodule update --remote --recursive


- It sounds like you're suggesting that we need to go into the submodule and manually checkout a specific commit?  Shouldn't the recursive clone pick up the HEAD of the submodule branch?


If it sounds like we don't quite understand what git is doing here, that's a fair statement ;-)  In particular, only the submodule branch is exposed to us, but it sounds like git internally stores the commit hash instead?

Thanks again for your help!
________________________________________
From: Lucas Seiki Oshiro <lucasseikioshiro@xxxxxxxxx>
Sent: Friday, April 4, 2025 10:59 AM
To: Torpey, Bill <Bill.Torpey@xxxxxxxxxxxxxx>
Cc: git@xxxxxxxxxxxxxxx <git@xxxxxxxxxxxxxxx>
Subject: Re: problem w/recursive, submodules?
 
This Message Is From an Unknown Sender
You have not previously corresponded with this sender.
 
> $ git clone -v -b master --recursive ssh://git@<internal>/nyfix/OpenMAMA-omnm.git

It's harder to understand the problem without being able to
reproduce it. Do you have another example with public
repositories?

> The commit hash from the recursive clone is the hash of a different (more recent) commit:

If I understood it correctly, it looks to me that it's
another case of one of the most common misconceptions about
submodules: they always reference a specific commit instead of
branch or the latest commit.

If you want your repository to reference other commit of your
submodule, you'll need to manually change this and commit this
change. One way you can do that:

cd <submodule>
git checkout <new commit of the submodule>
cd -
git add <submodule>
git commit

Note that you'll need to do that every time you want you want
your repository to reference other commit of the submodule.

This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system.





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux