* [PATCH] lib/oe/patch: avoid duplicated "From:" in generated patches
@ 2026-07-10 18:52 Yoann Congal
2026-07-13 12:59 ` [OE-core] " Alexander Kanavin
0 siblings, 1 reply; 7+ messages in thread
From: Yoann Congal @ 2026-07-10 18:52 UTC (permalink / raw)
To: openembedded-core; +Cc: Yoann Congal
From: Yoann Congal <yoann.congal@smile.fr>
To workaround issues with list.openembedded.org rewriting "From:" email
header, users are encouraged to put a "From:" header inside the mail
body. When using the suggested git-send-email workflow, users may use the
global git configs format.from=true and format.forceInBodyFrom=true:
man git-config:
> format.from
> Provides the default value for the --from option to
> format-patch. Accepts a boolean value, or a name and email
> address. If false, format-patch defaults to --no-from, using
> commit authors directly in the "From:" field of patch mails.
> If true, format-patch defaults to --from, using your committer
> identity in the "From:" field of patch mails and including a
> "From:" field in the body of the patch mail if different. If
> set to a non-boolean value, format-patch uses that value
> instead of your committer identity. Defaults to false.
>
> format.forceInBodyFrom
> Provides the default value for the --[no-]force-in-body-from
> option to format-patch. Defaults to false.
With this configuration, devtool generated patches look like:
|From 4457b9d7805551e6b35efa25f998b63901d4bf86 Mon Sep 17 00:00:00 2001
|From: Yoann Congal <yoann.congal@smile.fr>
|Subject: [PATCH] Add a new line
|
|From: Original Author <author@example.org>
|
|[rest of the patch]
Notice the duplicated "From:" header.
To fix the double "From:" header, use the --no-from option for
git-format-patch to override this configuration and generate only one
"From: Original Author <...>" header.
Note: The "format.from" configuration is in git since v2.10 (in 2016),
and the --no-from option before that.
Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
---
meta/lib/oe/patch.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py
index 1d50e83ab7a..0a201afe0ad 100644
--- a/meta/lib/oe/patch.py
+++ b/meta/lib/oe/patch.py
@@ -530,7 +530,7 @@ class GitApplyTree(PatchTree):
patches = []
try:
for name, rev in startcommits.items():
- cmd = ["git", "format-patch", "--no-signature", "--no-numbered", rev, "-o", tempdir]
+ cmd = ["git", "format-patch", "--no-from", "--no-signature", "--no-numbered", rev, "-o", tempdir]
if paths:
cmd.append('--')
cmd.extend(paths)
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [OE-core] [PATCH] lib/oe/patch: avoid duplicated "From:" in generated patches
2026-07-10 18:52 [PATCH] lib/oe/patch: avoid duplicated "From:" in generated patches Yoann Congal
@ 2026-07-13 12:59 ` Alexander Kanavin
2026-07-16 17:08 ` Yoann Congal
0 siblings, 1 reply; 7+ messages in thread
From: Alexander Kanavin @ 2026-07-13 12:59 UTC (permalink / raw)
To: yoann.congal; +Cc: openembedded-core
On Fri, 10 Jul 2026 at 20:52, Yoann Congal via lists.openembedded.org
<yoann.congal=smile.fr@lists.openembedded.org> wrote:
> With this configuration, devtool generated patches look like:
> |From 4457b9d7805551e6b35efa25f998b63901d4bf86 Mon Sep 17 00:00:00 2001
> |From: Yoann Congal <yoann.congal@smile.fr>
> |Subject: [PATCH] Add a new line
> |
> |From: Original Author <author@example.org>
> |
> |[rest of the patch]
> Notice the duplicated "From:" header.
>
> To fix the double "From:" header, use the --no-from option for
> git-format-patch to override this configuration and generate only one
> "From: Original Author <...>" header.
I don't understand. Why is the above problematic and why does it need fixing?
Alex
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [OE-core] [PATCH] lib/oe/patch: avoid duplicated "From:" in generated patches
2026-07-13 12:59 ` [OE-core] " Alexander Kanavin
@ 2026-07-16 17:08 ` Yoann Congal
2026-07-16 18:56 ` Alexander Kanavin
0 siblings, 1 reply; 7+ messages in thread
From: Yoann Congal @ 2026-07-16 17:08 UTC (permalink / raw)
To: Alexander Kanavin; +Cc: openembedded-core
On Mon Jul 13, 2026 at 2:59 PM CEST, Alexander Kanavin wrote:
> On Fri, 10 Jul 2026 at 20:52, Yoann Congal via lists.openembedded.org
> <yoann.congal=smile.fr@lists.openembedded.org> wrote:
>> With this configuration, devtool generated patches look like:
>> |From 4457b9d7805551e6b35efa25f998b63901d4bf86 Mon Sep 17 00:00:00 2001
>> |From: Yoann Congal <yoann.congal@smile.fr>
>> |Subject: [PATCH] Add a new line
>> |
>> |From: Original Author <author@example.org>
>> |
>> |[rest of the patch]
>> Notice the duplicated "From:" header.
>>
>> To fix the double "From:" header, use the --no-from option for
>> git-format-patch to override this configuration and generate only one
>> "From: Original Author <...>" header.
>
> I don't understand. Why is the above problematic and why does it need fixing?
>
> Alex
Hello Alex,
I really don't like this double "From:" header and I manually remove it
every time I (re)generate a patch with devtool.
I admit this is a matter of taste and that the problem only appears in
my configuration (it seems).
I won't mind is this patch is dropped, but, on the other hand it only
does force the default (--no-from)
Regards,
--
Yoann Congal
Smile ECS
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [OE-core] [PATCH] lib/oe/patch: avoid duplicated "From:" in generated patches
2026-07-16 17:08 ` Yoann Congal
@ 2026-07-16 18:56 ` Alexander Kanavin
2026-07-16 19:36 ` Yoann Congal
0 siblings, 1 reply; 7+ messages in thread
From: Alexander Kanavin @ 2026-07-16 18:56 UTC (permalink / raw)
To: Yoann Congal; +Cc: openembedded-core
On Thu, 16 Jul 2026 at 19:08, Yoann Congal <yoann.congal@smile.fr> wrote:
> >> To fix the double "From:" header, use the --no-from option for
> >> git-format-patch to override this configuration and generate only one
> >> "From: Original Author <...>" header.
> >
> > I don't understand. Why is the above problematic and why does it need fixing?
> >
> I really don't like this double "From:" header and I manually remove it
> every time I (re)generate a patch with devtool.
>
> I admit this is a matter of taste and that the problem only appears in
> my configuration (it seems).
>
> I won't mind is this patch is dropped, but, on the other hand it only
> does force the default (--no-from)
Can you provide a reproducer? What is the sequence of steps where this happens?
Alex
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [OE-core] [PATCH] lib/oe/patch: avoid duplicated "From:" in generated patches
2026-07-16 18:56 ` Alexander Kanavin
@ 2026-07-16 19:36 ` Yoann Congal
2026-07-17 15:27 ` Alexander Kanavin
0 siblings, 1 reply; 7+ messages in thread
From: Yoann Congal @ 2026-07-16 19:36 UTC (permalink / raw)
To: Alexander Kanavin; +Cc: openembedded-core
On Thu Jul 16, 2026 at 8:56 PM CEST, Alexander Kanavin wrote:
> On Thu, 16 Jul 2026 at 19:08, Yoann Congal <yoann.congal@smile.fr> wrote:
>> >> To fix the double "From:" header, use the --no-from option for
>> >> git-format-patch to override this configuration and generate only one
>> >> "From: Original Author <...>" header.
>> >
>> > I don't understand. Why is the above problematic and why does it need fixing?
>> >
>> I really don't like this double "From:" header and I manually remove it
>> every time I (re)generate a patch with devtool.
>>
>> I admit this is a matter of taste and that the problem only appears in
>> my configuration (it seems).
>>
>> I won't mind is this patch is dropped, but, on the other hand it only
>> does force the default (--no-from)
>
> Can you provide a reproducer? What is the sequence of steps where this happens?
>
> Alex
Sure, I can reproduce this from a pristine CROPS:debian-11:
$ git config --global user.name 'Yoann Congal'
$ git config --global user.email yoann.congal@smile.fr
# Config to avoid groups.io "From:" rewrites issues
$ git config --global format.from true
$ git config --global format.forceInBodyFrom true
# Basic poky-master setup with bitbake-setup
$ devtool modify bash
$ cd workspace/sources/bash
# Emulate cherry-picking a commit from the upstream git tree
$ echo TEST >> README
$ git commit -a --author 'Original Author <author@example.org>' -s -m "This is a test"
$ devtool update-recipe bash
$ head ../../../../layers/openembedded-core/meta/recipes-extended/bash/bash/0001-This-is-a-test.patch
From 8bbac77f0b749fc62e5ca5d924066d311e29c963 Mon Sep 17 00:00:00 2001
From: Yoann Congal <yoann.congal@smile.fr>
Date: Thu, 16 Jul 2026 19:31:55 +0000
Subject: [PATCH] This is a test
From: Original Author <author@example.org>
Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
---
README | 1 +
# Notice the double "From:" header above
Here, I usually edit the patch to replace my "From:" with the original
author's one.
Regards,
--
Yoann Congal
Smile ECS
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [OE-core] [PATCH] lib/oe/patch: avoid duplicated "From:" in generated patches
2026-07-16 19:36 ` Yoann Congal
@ 2026-07-17 15:27 ` Alexander Kanavin
2026-07-18 9:19 ` Yoann Congal
0 siblings, 1 reply; 7+ messages in thread
From: Alexander Kanavin @ 2026-07-17 15:27 UTC (permalink / raw)
To: Yoann Congal; +Cc: openembedded-core
On Thu, 16 Jul 2026 at 21:36, Yoann Congal <yoann.congal@smile.fr> wrote:
> # Config to avoid groups.io "From:" rewrites issues
> $ git config --global format.from true
> $ git config --global format.forceInBodyFrom true
Thanks, I was going to say this should not be set globally, but only
for repositories which explicitly use groups.io (e.g. oe-core). Then
devtool managed repos in devtool workspace will not have this problem.
But I see how this can be tedious to set in every bitbake-setup
checkout, and it's for some users easier as a global setting.
So the patch is right, but can you fold this additional discussion
into the commit message?
Alex
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [OE-core] [PATCH] lib/oe/patch: avoid duplicated "From:" in generated patches
2026-07-17 15:27 ` Alexander Kanavin
@ 2026-07-18 9:19 ` Yoann Congal
0 siblings, 0 replies; 7+ messages in thread
From: Yoann Congal @ 2026-07-18 9:19 UTC (permalink / raw)
To: Alexander Kanavin; +Cc: openembedded-core
On Fri Jul 17, 2026 at 5:27 PM CEST, Alexander Kanavin wrote:
> On Thu, 16 Jul 2026 at 21:36, Yoann Congal <yoann.congal@smile.fr> wrote:
>> # Config to avoid groups.io "From:" rewrites issues
>> $ git config --global format.from true
>> $ git config --global format.forceInBodyFrom true
>
> Thanks, I was going to say this should not be set globally, but only
> for repositories which explicitly use groups.io (e.g. oe-core). Then
> devtool managed repos in devtool workspace will not have this problem.
> But I see how this can be tedious to set in every bitbake-setup
> checkout, and it's for some users easier as a global setting.
>
> So the patch is right, but can you fold this additional discussion
> into the commit message?
Hello,
v2 sent with more context. I hope that'll be enough.
Thanks for the review :)
>
> Alex
--
Yoann Congal
Smile ECS
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-07-18 9:19 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-10 18:52 [PATCH] lib/oe/patch: avoid duplicated "From:" in generated patches Yoann Congal
2026-07-13 12:59 ` [OE-core] " Alexander Kanavin
2026-07-16 17:08 ` Yoann Congal
2026-07-16 18:56 ` Alexander Kanavin
2026-07-16 19:36 ` Yoann Congal
2026-07-17 15:27 ` Alexander Kanavin
2026-07-18 9:19 ` Yoann Congal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox