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

Cloning a clone with (relative) submodules

From
SLSterling, Brett A. (JSC-EG411)[Odyssey Space Research L.L.C.] <brett.a.sterling@nasa.gov>
Date
May 16, 2024, 13:20 UTC
Message-ID
<BLAPR09MB707587D4900A66FC8C405793BFED2@BLAPR09MB7075.namprd09.prod.outlook.com>

Thank you for filling out a Git bug report! Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue)

Created <ssh_repo_addr> including a submodule that is specified (in .gitmodules) as a relative path git clone <ssh_repo_addr> origClone git clone clone testClone

What did you expect to happen? (Expected behavior)
I expected 'testClone' to be a valid clone of origClone.  However, because the submodules are specified as a relative path, this no longer works.
What happened instead? (Actual behavior)

fatal: repository '<local_path>' does not exist fatal: clone of '<local_path_to_relative_submodule_director>' into submodule path '<local_path_to_submodule_in_testClone>' failed

What's different between what you expected and what actually happened?
See the error message above
Anything else you want to add:
The issue is that when a clone is made with submoodules that contain a relative path, the relative path is maintained verbatim.  What I believe _should_ happen is that when cloning with submodules, any submodule path should be replaced with a path relative to what is being cloned.  This would maintain the idea that the new clone reflects the first clone as the origin.

Please review the rest of the bug report below. You can delete any lines you don't wish to share.

[System Info] git version: git version 2.39.3 cpu: x86_64 no commit associated with this build sizeof-long: 8 sizeof-size_t: 8 shell-path: /bin/sh uname: Linux 4.18.0-513.24.1.el8_9.x86_64 #1 SMP Thu Mar 14 14:20:09 EDT 2024 x86_64 compiler info: gnuc: 8.5 libc info: glibc: 2.28 $SHELL (typically, interactive shell): /bin/tcsh

[Enabled Hooks]
Message 1 of 1 in “Cloning a clone with (relative) submodules”
  1. Sterling, Brett A. (JSC-EG411)[Odyssey Space Research L.L.C.]May 16, 2024

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.