Bug 16247 - patchtest: Check for missing spaces in modified patches
Summary: patchtest: Check for missing spaces in modified patches
Status: IN PROGRESS IMPLEMENTATION
Alias: None
Product: Patchwork/Patchtest
Classification: Yocto Project Subprojects
Component: Patchtest (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium enhancement
Target Milestone: 6.1
Assignee: Trevor Gamblin
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2026-04-15 12:24 UTC by Yoann Congal
Modified: 2026-04-20 18:19 UTC (History)
1 user (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments
Vibe-coded (Gemini) PoC script to check patch missing white space in context (It does work) (2.65 KB, text/x-python)
2026-04-20 12:52 UTC, Yoann Congal
yoann.congal: commit-
yoann.congal: copyright-waived+
yoann.congal: review-
Details

Note You need to log in before you can comment on or make changes to this bug.
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.