Crucible: unrecognised diff format. expected diff hunk descriptor but found

At qualys we use crucible. Great tool though it can sometimes be a PITA… Like today for example.
I had a pretty big patch made from several svn revs:

svn diff -r 23284:23747 -x -b > ~/tmp/code.patch

When I tried to upload that to crucible, I received the msg: "Error adding patch: Unrecognised diff format. Expected diff hunk descriptor but found:"

It's a known issue from atlassian that has been alive for more than 2 yrs: https://jira.atlassian.com/browse/CRUC-6114.

Thanks for fixing your bugs so fast btw...

Anyways the pb comes from the fact that the diff command gathers metadata as well as code changes.

Turns out there is a great tool called filterdiff, part of the patchutils package that cleans that up well.

brew install patchutils
filterdiff --clean code.patch > clean.patch

Crucible should stop whining after that