public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
* [OE-core][PATCH] pacth: add user and email when patchtool is git
@ 2026-03-13 11:53 Jose Quaresma
  2026-03-13 12:49 ` Richard Purdie
  0 siblings, 1 reply; 3+ messages in thread
From: Jose Quaresma @ 2026-03-13 11:53 UTC (permalink / raw)
  To: openembedded-core; +Cc: Jose Quaresma, Jose Quaresma

From: Jose Quaresma <jose.quaresma@oss.qualcomm.com>

When the PATCHTOOL=git, oe-core creates a git repo for the sources with:

 git init
 git add .
 git commit

The git commit 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>
---
 meta/lib/oe/patch.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py
index afc42df8a7..abc822f7fb 100644
--- a/meta/lib/oe/patch.py
+++ b/meta/lib/oe/patch.py
@@ -318,6 +318,8 @@ class GitApplyTree(PatchTree):
 
     def _initRepo(self):
         runcmd("git init".split(), self.dir)
+        runcmd(("git config user.email %s" % self.commitemail).split(), self.dir)
+        runcmd(("git config user.name %s" % self.commituser).split(), self.dir)
         runcmd("git add .".split(), self.dir)
         runcmd("git commit -a --allow-empty -m bitbake_patching_started".split(), self.dir)
 
-- 
2.53.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [OE-core][PATCH] pacth: add user and email when patchtool is git
  2026-03-13 11:53 [OE-core][PATCH] pacth: add user and email when patchtool is git Jose Quaresma
@ 2026-03-13 12:49 ` Richard Purdie
  2026-03-13 17:17   ` Jose Quaresma
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Purdie @ 2026-03-13 12:49 UTC (permalink / raw)
  To: quaresma.jose, openembedded-core; +Cc: Jose Quaresma, Jose Quaresma

On Fri, 2026-03-13 at 11:53 +0000, Jose Quaresma via lists.openembedded.org wrote:
> From: Jose Quaresma <jose.quaresma@oss.qualcomm.com>
> 
> When the PATCHTOOL=git, oe-core creates a git repo for the sources with:
> 
>  git init
>  git add .
>  git commit
> 
> The git commit 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>
> ---
>  meta/lib/oe/patch.py | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py
> index afc42df8a7..abc822f7fb 100644
> --- a/meta/lib/oe/patch.py
> +++ b/meta/lib/oe/patch.py
> @@ -318,6 +318,8 @@ class GitApplyTree(PatchTree):
>  
>      def _initRepo(self):
>          runcmd("git init".split(), self.dir)
> +        runcmd(("git config user.email %s" % self.commitemail).split(), self.dir)
> +        runcmd(("git config user.name %s" % self.commituser).split(), self.dir)

If my name is "Richard Purdie", does that split() do the right thing?

You may just have to split it out in advance:

runcmd(["git, "config", "user.name", self.commituser], self.dir)

Cheers,

Richard


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [OE-core][PATCH] pacth: add user and email when patchtool is git
  2026-03-13 12:49 ` Richard Purdie
@ 2026-03-13 17:17   ` Jose Quaresma
  0 siblings, 0 replies; 3+ messages in thread
From: Jose Quaresma @ 2026-03-13 17:17 UTC (permalink / raw)
  To: Richard Purdie; +Cc: OE-core, Jose Quaresma, Jose Quaresma

[-- Attachment #1: Type: text/plain, Size: 2127 bytes --]

Best regards,

José Quaresma

A sexta, 13/03/2026, 12:49, Richard Purdie <
richard.purdie@linuxfoundation.org> escreveu:

> On Fri, 2026-03-13 at 11:53 +0000, Jose Quaresma via
> lists.openembedded.org wrote:
> > From: Jose Quaresma <jose.quaresma@oss.qualcomm.com>
> >
> > When the PATCHTOOL=git, oe-core creates a git repo for the sources with:
> >
> >  git init
> >  git add .
> >  git commit
> >
> > The git commit 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>
> > ---
> >  meta/lib/oe/patch.py | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py
> > index afc42df8a7..abc822f7fb 100644
> > --- a/meta/lib/oe/patch.py
> > +++ b/meta/lib/oe/patch.py
> > @@ -318,6 +318,8 @@ class GitApplyTree(PatchTree):
> >
> >      def _initRepo(self):
> >          runcmd("git init".split(), self.dir)
> > +        runcmd(("git config user.email %s" % self.commitemail).split(),
> self.dir)
> > +        runcmd(("git config user.name %s" % self.commituser).split(),
> self.dir)
>
> If my name is "Richard Purdie", does that split() do the right thing?
>

I've been following trends, I like to hallucinate a bit so I don't feel
disintegrated :p


> You may just have to split it out in advance:
>
> runcmd(["git, "config", "user.name", self.commituser], self.dir)
>

It only works for the default case:
Author: OpenEmbedded <oe.patch@oe>

But as you rightly point out, it doesn't work in general.

Thanks, I will send a v2.

Jose



> Cheers,
>
> Richard
>

[-- Attachment #2: Type: text/html, Size: 3649 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-03-13 17:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-13 11:53 [OE-core][PATCH] pacth: add user and email when patchtool is git Jose Quaresma
2026-03-13 12:49 ` Richard Purdie
2026-03-13 17:17   ` Jose Quaresma

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox