I just experienced an issue where a patch listed in SRC_URI of a linux-yocto_%.bbapend file was not applied, without any errors. I tracked it down to the fact that one of the following patches in SRC_URI was already applied. For example, suppose SRC_URI="a b c" and "b" is already applied. kgit-s2q when called via patchme -> kgit-meta/do_pending_patches() then finds "b" in the already applied patches, uses it as resume point and skips "a". One could argue that none of the patches in SRC_URI should be already present, but I disagree. For example, a .bbappend file might add a new patch, then later the underlying kernel gets updated such that it contains the same patch. My expectation is that the redundant patch (and only that patch) gets skipped (possibly with warning) or an error gets generated. I'd be fine with both.
There's no easy way to do this, without validating each and every patch in the branch, and that isn't something we will do. The design is to locate a resume point, and resume from there. We already have patch time issues on queues of 10k+ patches, and doing individual patch application, detection and skipping isn't going to be possible without significantly increasing the patch time. This might be possible as an optional mode of the script's processing, so I'm tagging this as an enhancement .. since it absolutely is not a bug.
To clarify. There are some updates to the tools that just came out that give us the flexibility to trap this case as an error, and abort the patching phase. That will make it clear to the user that the series is invalid.
*** Bug 7788 has been marked as a duplicate of this bug. ***