patchwork-bot: Ignore empty context lines

It seems that there is some mismatch in diff output (or storage?) between
git and patchwork under conditions I haven't figured out (MUA or MTA
whitespace stripping?): patchwork appears to ignore empty context lines
(i.e. a line that is only a single space). As a result, the patchwork
hash will not match, and commits will not be identified in patchwork.

As an example of a commit in upstream that patchwork-bot cannot locate
in patchwork due to a different hash, due to the differing empty context

$ wget -qO-$MSGID/raw/ | \
	grep '^ $' | wc -l

$ SHA=f11ee2ad25b22c2ee587045dd6999434375532f7
$ git diff ${SHA}~..${SHA} | \
	grep '^ $' | wc -l

Teaching patchwork-bot to ignore empty context lines allows pwhashes to
match in these cases, which lets those patches get located again.

Signed-off-by: Kees Cook <>
Signed-off-by: Konstantin Ryabitsev <>
1 file changed