Patch Set 2: I would prefer that you didn't submit this

(3 inline comments)

see my inline comments. could you also add some tests that verify that patches are properly generated in different formats ?