public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Clement Faure <clement.faure@arm.com>
To: openembedded-core@lists.openembedded.org
Cc: saul.wold@windriver.com, ross.burton@arm.com,
	Clement Faure <clement.faure@arm.com>
Subject: [PATCH v2 1/2] devtool: avoid recursion into nested git repos with submodules
Date: Thu, 12 Feb 2026 11:38:02 +0100	[thread overview]
Message-ID: <20260212103803.63277-2-clement.faure@arm.com> (raw)
In-Reply-To: <20260212103803.63277-1-clement.faure@arm.com>

Prevent devtool from recursing into nested git repositories with
submodules to avoid double git submodule add operation.

Signed-off-by: Clement Faure <clement.faure@arm.com>
---
changes in v2:
- look for .gitmodules in files instead of dirs + files
---

 scripts/lib/devtool/__init__.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/__init__.py
index 969d6dc13a..1359473496 100644
--- a/scripts/lib/devtool/__init__.py
+++ b/scripts/lib/devtool/__init__.py
@@ -248,6 +248,10 @@ def setup_git_repo(repodir, version, devbranch, basetag='devtool-base', d=None):
                     remote_url = stdout.splitlines()[0]
                     logger.error(os.path.relpath(os.path.join(root, ".."), root))
                     bb.process.run('git submodule add %s %s' % (remote_url, os.path.relpath(root, os.path.join(root, ".."))), cwd=os.path.join(root, ".."))
+                    # Do not descend into nested git repos that have submodules themselves.
+                    if ".gitmodules" in files:
+                        logger.warning('Nested git repository with submodules %s; devtool will not recurse into it', root)
+                        dirs[:] = []
                     found = True
                 if found:
                     oe.patch.GitApplyTree.commitIgnored("Add additional submodule from SRC_URI", dir=os.path.join(root, ".."), d=d)
-- 
2.43.0



  reply	other threads:[~2026-02-12 10:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-12 10:38 [PATCH v2 0/2] devtool: handle nested git repos with submodules Clement Faure
2026-02-12 10:38 ` Clement Faure [this message]
2026-02-12 10:38 ` [PATCH v2 2/2] oeqa/selftest/devtool: add devtool modify testcase for nested gitsm Clement Faure

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=20260212103803.63277-2-clement.faure@arm.com \
    --to=clement.faure@arm.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=ross.burton@arm.com \
    --cc=saul.wold@windriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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