Support for format-patch

This PR adds support for ```git format-patch``` behaviour. This is something we need to have for rebases  #2253 and core git compatibility (```git rebase``` uses ```git am```).

It cannot currently generate a "patch" for merge commits (depends on #1965). It also does not do rename detection as ```git format-patch``` will generate an add/remove patch. If need be, we can add support for this behaviour. I'm not sure if core git will croak on it though :smile: