]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
lib/oe/patch: add user and email when patchtool is git
authorJose Quaresma <jose.quaresma@oss.qualcomm.com>
Fri, 13 Mar 2026 17:16:35 +0000 (17:16 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 16 Mar 2026 16:49:05 +0000 (16:49 +0000)
When the PATCHTOOL=git, oe-core creates a git repo for the sources with:

 git init
 git add .
 git commit

The git commit can fails blindly due to misconfigured user when git don't have
the email proper configured. Although the commit command does not fail
because it returns 0, it is not executed and the tree remains with all
files staged so the following git commands can fail and fails in some cases.

This problem has been particularly observed in some obscure and little-used
cases in openembedded-core like patching the linux-firmware which only works
using PATCHTOOL=git because it deals with binary files.

Signed-off-by: Jose Quaresma <jose.quaresma@oss.qualcomm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oe/patch.py

index afc42df8a7e29483ec00f0b1c05780bde3d84f81..2cd8de22c7243c679907a82a7182aea059b638b2 100644 (file)
@@ -318,6 +318,8 @@ class GitApplyTree(PatchTree):
 
     def _initRepo(self):
         runcmd("git init".split(), self.dir)
+        runcmd(["git", "config", "user.email", self.commitemail], self.dir)
+        runcmd(["git", "config", "user.name", self.commituser], self.dir)
         runcmd("git add .".split(), self.dir)
         runcmd("git commit -a --allow-empty -m bitbake_patching_started".split(), self.dir)