patchew-project/patchew

Incorrect extraction of diffstat

Closed this issue · 6 comments

Patch posted.

Ironically, the patchew page for this patch shows another bug in diffstat extraction. My first version of the patch also bailed out at lines starting with "diff", but I was afraid that this could have false positives in the commit message. Maybe we could bail at "diff" if a diffstat was found before (i.e. ret != []).

We could also require a "---" line before the diffstat, but there are people that are using e.g. quilt instead of git format-patch and do not include such a line. Overall the remaining case seems like a minor issue.

famz commented

Maybe two consequent lines

diff ...
index ...

is better?

--- is simpler and even better for avoiding false positives.

I mean stopping at ---.