Git Mailing List Archive mirror
 help / color / mirror / Atom feed
From: "Sterling, Brett A. (JSC-EG411)[Odyssey Space Research L.L.C.]" <>
To: "" <>
Subject: Cloning a clone with (relative) submodules
Date: Thu, 16 May 2024 13:20:58 +0000	[thread overview]
Message-ID: <> (raw)

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]

                 reply	other threads:[~2024-05-16 13:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).