(note that in m_fileToPatch patches are not added twice. That member seems to be used for some file watching. Maybe it can be used for conflicts too, it has the same structure as filesConflict)
It should be trivial to suppress this, when the hunks patching the same file come from a single patch.
But as already stated: The much better solution would be to generally check for conflict detection, if two hunks really collide, i.e. if they patch the same lines in the same file.
This would ultimately reduce the vast number of false positive patch conflict warnings, when a lot of patches are installed; i.e. these messages would become trustable information, not just a vague hint.
If a patch has several hunks for the same file, the
+++
prefix appears more than one time, and it is added more than once tofilesConflict
(https://github.com/sailfishos-patches/patchmanager/blob/dc781cdcb365a60ca2333b141decbf88e92a0626/src/bin/patchmanager-daemon/patchmanagerobject.cpp#L1600).Example patch: https://coderus.openrepos.net/pm2/project/browser-history-swipes
(note that in
m_fileToPatch
patches are not added twice. That member seems to be used for some file watching. Maybe it can be used for conflicts too, it has the same structure as filesConflict)