Bug 16088

Summary: patchtest throws an error on a patch with "From " in the message
Product: [Yocto Project Subprojects] Patchwork/Patchtest Reporter: Yoann Congal <yoann.congal>
Component: PatchtestAssignee: Trevor Gamblin <tgamblin>
Status: NEW --- QA Contact:
Severity: normal    
Priority: Medium+ CC: randy.macleod, yoann.congal
Version: unspecified   
Target Milestone: 6.1 M1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Attachments:
Description Flags
Patch triggering the bug none

Description Yoann Congal 2025-12-04 11:14:35 UTC
Created attachment 5157 [details]
Patch triggering the bug

With a patch starting with a line starting with "From ..." in the commit message, patchtest fails with (full log bellow):
  File ".../poky/scripts/../meta/lib/patchtest/mbox.py", line 51, in __init__
    self.diff = self.split_body[1]
                ~~~~~~~~~~~~~~~^^^
  IndexError: list index out of range

The patch (attached to this bug starts with):
  From e0c4001eaea6e8a30bcfce6616e8fc8b5ea4710e Mon Sep 17 00:00:00 2001
  From: Yoann Congal <yoann.congal@smile.fr>
  Date: Thu, 4 Dec 2025 10:57:40 +0100
  Subject: [PATCH] kernel.bbclass: copy include/config/auto.conf in
   STAGING_KERNEL_BUILDDIR
  
  From: Yoann Congal <yoann.congal@smile.fr>
  
  From Linux commit aaed5c7739be ("kbuild: slim down package for building
  external modules")[0], include/config/auto.conf is also a file needed for
  out-of-tree build.

Full log:
 $ patchtest --patch ../../layers/poky/0001-kernel.bbclass-copy-include-config-auto.conf-in-STAG.patch 
Testing patch ../../layers/poky/0001-kernel.bbclass-copy-include-config-auto.conf-in-STAG.patch
Traceback (most recent call last):
  File ".../poky/scripts/patchtest", line 61, in startTestRun
    self.repo = PatchtestParser.repo = PatchTestRepo(**repoargs)
                                       ~~~~~~~~~~~~~^^^^^^^^^^^^
  File ".../poky/scripts/../meta/lib/patchtest/repo.py", line 23, in __init__
    self.patch = mbox.PatchSeries(patch)
                 ~~~~~~~~~~~~~~~~^^^^^^^
  File ".../poky/scripts/../meta/lib/patchtest/mbox.py", line 56, in __init__
    self.patches = [Patch(message) for message in mbox]
                    ~~~~~^^^^^^^^^
  File ".../poky/scripts/../meta/lib/patchtest/mbox.py", line 51, in __init__
    self.diff = self.split_body[1]
                ~~~~~~~~~~~~~~~^^^
IndexError: list index out of range
None
----------------------------------------------------------------------
Ran 0 tests in 0.021s

NO TESTS RAN
Traceback (most recent call last):
  File ".../poky/scripts/patchtest", line 61, in startTestRun
    self.repo = PatchtestParser.repo = PatchTestRepo(**repoargs)
                                       ~~~~~~~~~~~~~^^^^^^^^^^^^
  File ".../poky/scripts/../meta/lib/patchtest/repo.py", line 23, in __init__
    self.patch = mbox.PatchSeries(patch)
                 ~~~~~~~~~~~~~~~~^^^^^^^
  File ".../poky/scripts/../meta/lib/patchtest/mbox.py", line 56, in __init__
    self.patches = [Patch(message) for message in mbox]
                    ~~~~~^^^^^^^^^
  File ".../poky/scripts/../meta/lib/patchtest/mbox.py", line 51, in __init__
    self.diff = self.split_body[1]
                ~~~~~~~~~~~~~~~^^^
IndexError: list index out of range
None
----------------------------------------------------------------------
Ran 0 tests in 0.021s

NO TESTS RAN
----------------------------------------------------------------------

OK: patchtest: All patchtests passed
----------------------------------------------------------------------
Comment 1 Yoann Congal 2025-12-04 11:25:07 UTC
Also, note that patchtest did return a success (where I would have expected a failure)
Comment 2 Randy MacLeod 2025-12-11 15:45:15 UTC
From Linux commit aaed5c7739be 
^^^^ probably the root cause.