[v2,2/2] devtool: don't exec patch commit task funcs for git submodules

Message ID 20220208122500.429218-2-bkylerussell@gmail.com
State New
Headers show
Series [v2,1/2] devtool: get hooks directory path from git rev-parse | expand

Commit Message

Kyle Russell Feb. 8, 2022, 12:25 p.m. UTC
When applying a patch directly to a submodule, devtool doesn't need to
generate commits for updated submodule revisions, which may differ each
time a patch is applied to a devtool workspace.  (submodule revision
commits would be effectively useless unless the patch is pushed to a
remote repo from devtool, at which time a commit should be generated by
the user anyway.)

Additionally, attempting to commit new submodule revisions in the parent
repo may error with "no changes added to commit" if the patched module
is nested within multiple submodules below the parent repo.  (Devtool
doesn't and shouldn't recusively create commits on each submodule.)

Signed-off-by: Kyle Russell <bkylerussell@gmail.com>
---
 scripts/lib/devtool/standard.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch

diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 01fb5ad96f..5282253ac4 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -569,7 +569,8 @@  def _extract_source(srctree, keep_temp, devbranch, sync, config, basepath, works
             f.write('DEVTOOL_DEVBRANCH = "%s"\n' % devbranch)
             if not is_kernel_yocto:
                 f.write('PATCHTOOL = "git"\n')
-                f.write('PATCH_COMMIT_FUNCTIONS = "1"\n')
+                if not 'gitsm' in d.getVar('SRC_URI'):
+                    f.write('PATCH_COMMIT_FUNCTIONS = "1"\n')
             if extra_overrides:
                 f.write('DEVTOOL_EXTRA_OVERRIDES = "%s"\n' % ':'.join(extra_overrides))
             f.write('inherit devtool-source\n')