-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for "git clone --recursive" to pull in submodules #96
Comments
Probably need some discussion about whether this would be default behavior, or if we need a -r flag or similar to checkout_externals. Another option might be to put it in the Externals.cfg for a particular external, e.g.: [mom] Or something similar... |
Thanks, @rsdunlapiv . Is there any downside of always adding the And is there ever anything else you need to do for submodules to work correctly? e.g., in the |
I would like to see a bit more of the proposed semantics to make sure that |
I would also be interested in having this option added, but agree that thinking through the situation when submodules change is important. |
I've been talking to @dabail10 about this (and learning about submodules as I go. It seems like the current approach taken by manage externals is
The desired results of pulling down submodules could be achieved by adding
I gave Dave the following source mod for
That seemed to work for his needs (checking out CICE and its submodules). If you checkout one version of CICE with this and then change The one thing I did test is that running |
I've talked more with @dabail10 and also looked into the mechanisms of git submodules a little bit. Without getting too technical, I think it should be possible to combine the contents of
To address
Hopefully this allays concerns raised by @gold2718, because it's effectively treating a component that has submodules as though it uses |
Would this also work for recursively (or could it, with a switch?) |
Proposed behavior from a meeting: if This is preferable to the code change I mentioned above because changes to submodules will be caught by We may also need Last item for the wish list: for cases where we will use
with
|
I am still trying to wrap my head around the proposed semantics. First, here is what I think we all agreed should work:
Okay so far? So what happens if
Is everyone okay with that? If not, please propose bulletproof semantics for that situation. |
@mnlevy1981 suggested a modified config entry to use
In this case, note that the name of the external conflicts with the name in the
Do we want an exact match (requiring, in this case, modifying Externals_MOM.cfg)? Do we want to match the part of the submodule name after the last slash ( |
I haven't been following this closely enough to give any helpful thoughts. I'm happy to go with whatever you guys want here. If you want another opinion, though, I'm willing to give one, but in that case, can we find some time to sit down together to talk this through? |
New capability to use git submodule info to checkout externals By default, an external with no specified sub-externals configuration file will have its submodules checked out according to the information in that repository's .gitmodules file. This process is recursive. To prevent submodules from being checked out, the external description for that repository should be listed as "externals = none". To use submodule URL, local path, and reference hash information for a sub-external, replace the 'local_path', 'repo_url', and 'branch' 'hash' or 'tag' keywords with "from_submodule = True". User interface changes?: Yes externals keyword can be "none" to prevent loading submodules. from_submodule keyword can be used to replace external configuration information with information from a repository's submodule configuration. Fixes: #96 Testing: test removed: none unit tests: all pass system tests: all pass, added TestSubrepoCheckout to test new functionality manual testing: Tests with ESCOMP/MOM_interface (see below) Just run checkout_externals: no change Remove "externals = ../Externals_MOM.cfg" from Externals.cfg: All four submodules of MOM6 checked out Set "externals = none" in Externals.cfg: No submodules checked out (empty directories) Modify da_hooks external in Externals_MOM.cfg (see below): da_hooks is checked out with MOM6 .gitmodules configuration. [pkg/MOM6_DA_hooks] protocol = git from_submodule = True required = True
Summary of Issue:
When cloning a git external, it does not automatically pull in the submodules of the cloned repo. To do this, we'd need to add a "--recursive" option to the git clone command. Good resource on this: http://www.vogella.com/tutorials/GitSubmodules/article.html
Expected behavior and actual behavior:
This is expected so far, but adding the recursive option would reduce number of manual steps when checking out an external that has submodules.
Steps to reproduce the problem (should include model description file(s) or link to public repository):
Add any git repo that has submodules to an Externals.cfg and execute checkout_externals. The submodules will not be present (yet) in the cloned repo.
What is the changeset ID of the code, and the machine you are using:
master as of 4/10/18
have you modified the code? If so, it must be committed and available for testing:
No
Screen output or log file showing the error message and context:
The text was updated successfully, but these errors were encountered: