Bug 16247

Summary: patchtest: Check for missing spaces in modified patches
Product: [Yocto Project Subprojects] Patchwork/Patchtest Reporter: Yoann Congal <yoann.congal>
Component: PatchtestAssignee: Trevor Gamblin <tgamblin>
Status: IN PROGRESS IMPLEMENTATION --- QA Contact:
Severity: enhancement    
Priority: Medium CC: randy.macleod
Version: unspecified   
Target Milestone: 6.1   
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
Vibe-coded (Gemini) PoC script to check patch missing white space in context (It does work) yoann.congal: commit-, yoann.congal: copyright-waived+, yoann.congal: review-

Description Yoann Congal 2026-04-15 12:24:02 UTC
In patches, an empty context line translate to a patch line "+ ".
Some tools consider the space ending the line an error, remove it and technically corrupt the patch.

We could add a check in patchtest to error on such patches.

Counterpoint: GNU patch (and most the patch tools I could find) handle this case gracefully and silently.

Related:
9876 – patchtest-oe: check that attached SW patches does not contain trailing spaces
https://bugzilla.yoctoproject.org/show_bug.cgi?id=9876
Comment 1 Yoann Congal 2026-04-20 12:52:32 UTC
Created attachment 5208 [details]
Vibe-coded (Gemini) PoC script to check patch missing white space in context (It does work)

Added my vibe-coded (Gemini) PoC script to check patch missing white spaces in context. It does work.