<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>14146</bug_id>
          
          <creation_ts>2020-12-08 16:27:34 +0000</creation_ts>
          <short_desc>Post-patch hook fails with submodules and PATCHTOOL=git and PATCH_COMMIT_FUNCTIONS=1</short_desc>
          <delta_ts>2026-02-19 16:19:45 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>core</component>
          <version>3.4</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard> </status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>6.99</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ross Burton">ross.burton</reporter>
          <assigned_to name="Unassigned">unassigned</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>pavel</cc>
    
    <cc>randy.macleod</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>88732</commentid>
    <comment_count>0</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2020-12-08 16:27:34 +0000</bug_when>
    <thetext>If a recipe puts a git repo inside another git repo (submodules) and patches the submodule, the patch postfunc fails when PATCHTOOL=git PATCH_COMMIT_FUNCTIONS=1.

ERROR: devtool-test-multisrc-subdir-1.0-r0 do_patch: Error executing a python function in exec_python_func() autogenerated:

The stack trace of python calls that resulted in this exception/failure was:
File: &apos;exec_python_func() autogenerated&apos;, lineno: 2, function: &lt;module&gt;
     0001:
 *** 0002:patch_task_postfunc(d)
     0003:
File: &apos;/home/ross/Yocto/poky/meta/classes/patch.bbclass&apos;, lineno: 82, function: patch_task_postfunc
     0078:        stdout, _ = bb.process.run(&apos;git status --porcelain .&apos;, cwd=srcsubdir)
     0079:        if stdout:
     0080:            useroptions = []
     0081:            oe.patch.GitApplyTree.gitCommandUserOptions(useroptions, d=d)
 *** 0082:            bb.process.run(&apos;git add .; git %s commit -a -m &quot;Committing changes from %s\n\n%s&quot;&apos; % (&apos; &apos;.join(useroptions), func, oe.patch.GitApplyTree.ignore_commit_prefix + &apos; - from %s&apos; % func), cwd=srcsubdir)
     0083:}
     0084:
     0085:def src_patches(d, all=False, expand=True):
     0086:    import oe.patch
File: &apos;/home/ross/Yocto/poky/bitbake/lib/bb/process.py&apos;, lineno: 184, function: run
     0180:        if not stderr is None:
     0181:            stderr = stderr.decode(&quot;utf-8&quot;)
     0182:
     0183:    if pipe.returncode != 0:
 *** 0184:        raise ExecutionError(cmd, pipe.returncode, stdout, stderr)
     0185:    return stdout, stderr
Exception: bb.process.ExecutionError: Execution of &apos;git add .; git -c user.name=&quot;OpenEmbedded&quot; -c user.email=&quot;oe.patch@oe&quot; commit -a -m &quot;Committing changes from do_patch

%% ignore - from do_patch&quot;&apos; failed with exit code 1:
On branch master
Your branch is ahead of &apos;origin/master&apos; by 1 commit.
  (use &quot;git push&quot; to publish your local commits)

Changes not staged for commit:
  (use &quot;git add &lt;file&gt;...&quot; to update what will be committed)
  (use &quot;git restore &lt;file&gt;...&quot; to discard changes in working directory)
  (commit or discard the untracked or modified content in submodules)
	modified:   libfakekey (modified content)

no changes added to commit (use &quot;git add&quot; and/or &quot;git commit -a&quot;)


ERROR: Logfile of failure stored in: /yocto/ross/build/tmp/work/neoversen1-poky-linux/devtool-test-multisrc-subdir/1.0-r0/temp/log.do_patch.1796167
ERROR: Task (/home/ross/Yocto/poky/meta/recipes-devtools/devtool/devtool-test-multisrc-subdir_1.0.bb:do_patch) failed with exit code &apos;1&apos;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91230</commentid>
    <comment_count>1</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2021-08-19 15:20:04 +0000</bug_when>
    <thetext>Rather than doing the patching with git, could we use quilt ? (Randy typing for Richard)

 PATCHTOOL=git with submodules should just fail with an error.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96892</commentid>
    <comment_count>2</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-10-24 14:24:38 +0000</bug_when>
    <thetext>Bulk move from 4.99 or 0.00 to 5.99</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>