>> Another approach would be to first go through the patch and check that all >> hunks apply without problems, and then, on the second pass, actually apply >> them. > > This is a better option, thanks for the idea, will try to do this with > 'diff-test-hunk' in a loop. Indeed, this is much better: