analyze() fails to correctly parse a patch header that has a line that matches two of the three hunk detection regular expressions because it treats them in isolation rather than as a linked, ordered, series. josch in IRC's #debian-mentors reported this error: dpkg-source: error: expected ^--- in line 7 of diff 'mesa-24.3.4.orig.JVu23i/debian/patches/mesa25/2079-radeonsi-fix-a-TCS-regression.patch' The cause being the isolated "@@ -" in the patch header that was directly taken from git-format-patch (here prefixed with "> " to avoid causing the same error!): ... My patch revises the parsing logic to treat the three hunk markers as ordered and linked.
Hi! Thanks for looking into it, and the patch! Although as I mentioned to josch on IRC, this is #1081434, where accepting such change would not be correct. I'm thus going to close this as a duplicate. If there's anything new not covered in that other report, then please update that one instead. Thanks, Guillem
Revised patch that fixes an issue where $patchheader incorrectly included the hunk preamble.
The (forgotten) revised patch!
Apologies that the previous attached patch did NOT include the changes I described. This one definitely does include dealing with partial hunk preambles correctly.
Hi! Ah, right (thanks for the private reply with the reasoning, although in general it would be better to send those to the bug directly! :), I see I was probably too quick to put this and the bug I referred in the same category, but they are indeed slightly different. I'm reopening for now to avoid it being archived, but I've still got some concerns that are similar to the ones affecting the other related bug, so in the end I think both might end up being unfixable for now. I'll ponder about this a bit, then give a reasoned reply later on. Thanks, Guillem