Calculate the diff stats of a patch when generating the patch

This patch gives the ability to generate the diff stats of a patch which
is similar to 'git diff --stats'