* [PATCH b4] Handle author A, submitter B, committer A SOB chain correctly
@ 2025-03-03 16:20 Thomas Gleixner
0 siblings, 0 replies; only message in thread
From: Thomas Gleixner @ 2025-03-03 16:20 UTC (permalink / raw)
To: tools; +Cc: Konstantin Ryabitsev
The trailer handling of b4 fails to handle one particular case
correctly:
Dev A posts a patch with his SOB
Subject: [PATCH] subsys: Something
From: Dev A <deva@k.org>
Some explanation
Signed-off-by: Dev A <deva@k.org>
Dev B picks the patch up, adds his SOB and reposts it in a follow up
series:
Subject: [PATCH v2 1/5] subsys: Something
From: Dev B <devb@k.org>
From: Dev A <deva@k.org>
Some explanation
Signed-off-by: Dev A <deva@k.org>
Signed-off-by: Dev B <devb@k.org>
Now Dev A who is also the maintainer picks the series up and b4 converts
it to:
Author: Dev A <deva@k.org>
subsys: Something
Some explanation
Signed-off-by: Dev B <devb@k.org>
Signed-off-by: Dev A <deva@k.org>
While Dev A is correctly assigned to be the author of the commit, the
SOB chain is incorrect because the first SOB is not the author's
SOB. The correct resolution for this is:
Author: Dev A <deva@k.org>
subsys: Something
Some explanation
Signed-off-by: Dev A <deva@k.org>
Signed-off-by: Dev B <devb@k.org>
Signed-off-by: Dev A <deva@k.org>
Validate that the committers SOB is the last one in the SOB chain and
only remove it from processing if that's true. If the committers SOB is
before the last SOB in the submission, then keep the ordering intact and
add an extra committer SOB at the end.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
src/b4/__init__.py | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
--- a/src/b4/__init__.py
+++ b/src/b4/__init__.py
@@ -2205,9 +2205,22 @@ MAILMAP_INFO = dict()
sobtr = LoreTrailer()
hasmysob = False
if sobtr in btrailers:
+
+ found = False
+ last = True
+ for bltr in btrailers:
+ if not found:
+ found = bltr == sobtr
+ else:
+ if bltr.lname == 'signed-off-by':
+ last = False
+ break
+
# Our own signoff always moves to the bottom of all trailers
- hasmysob = True
- btrailers.remove(sobtr)
+ # if it is the last signoff in the chain.
+ if last:
+ hasmysob = True
+ btrailers.remove(sobtr)
new_trailers = self.followup_trailers
if extras:
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-03-03 16:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-03 16:20 [PATCH b4] Handle author A, submitter B, committer A SOB chain correctly Thomas Gleixner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).