{"thread":{"id":"14939","subject":"[PATCH] Add option hooks.emaildiff to include full diff in post-receive-email.","startedAt":"2008-08-11T21:01:31Z","lastAt":"2008-08-11T21:01:31Z","messageCount":1,"participants":["Jon Jensen"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"86833","messageId":"1218488491-21236-1-git-send-email-jon@endpoint.com","threadId":"14939","inReplyTo":null,"subject":"[PATCH] Add option hooks.emaildiff to include full diff in post-receive-email.","fromName":"Jon Jensen","fromEmail":"jon@endpoint.com","sentAt":"2008-08-11T21:01:31Z","receivedAt":"2008-08-11T21:01:31Z","isPatch":true,"sender":{"key":"jon@endpoint.com","avatar":"https://avatars.githubusercontent.com/u/3811?v=4"},"body":"I've always found that a very important part of receiving email\nnotification of commits is being able to read the diff inline,\neasily, where I can reply and quote the diff and make comments.\nIt's similar to the reason patches sent to the Git mailing list\nneed to be inline, not attachments.\n\nSince post-receive-email didn't have that option, I added it as a\nboolean config variable, hooks.emaildiff.\n---\n contrib/hooks/post-receive-email |   13 +++++++++++--\n 1 files changed, 11 insertions(+), 2 deletions(-)\n\ndiff --git a/contrib/hooks/post-receive-email b/contrib/hooks/post-receive-email\nindex 4136895..07351cc 100644\n--- a/contrib/hooks/post-receive-email\n+++ b/contrib/hooks/post-receive-email\n@@ -38,6 +38,9 @@\n # hooks.emailprefix\n #   All emails have their subjects prefixed with this prefix, or \"[SCM]\"\n #   if emailprefix is unset, to aid filtering\n+# hooks.emaildiff\n+#   If set, then a full diff of changes is sent in addition to the default\n+#   summary output.\n #\n # Notes\n # -----\n@@ -410,8 +413,13 @@ generate_update_branch_email()\n \t# - including the undoing of previous revisions in the case of\n \t# non-fast forward updates.\n \techo \"\"\n-\techo \"Summary of changes:\"\n-\tgit diff-tree --stat --summary --find-copies-harder $oldrev..$newrev\n+\tif [ -n \"$emaildiff\" ]; then\n+\t\techo \"Summary of changes and diff:\"\n+\t\tgit diff-tree --find-copies-harder --stat --summary -p $oldrev..$newrev\n+\telse\n+\t\techo \"Summary of changes:\"\n+\t\tgit diff-tree --find-copies-harder --stat --summary $oldrev..$newrev\n+\tfi\n }\n \n #\n@@ -627,6 +635,7 @@ recipients=$(git config hooks.mailinglist)\n announcerecipients=$(git config hooks.announcelist)\n envelopesender=$(git config hooks.envelopesender)\n emailprefix=$(git config hooks.emailprefix || echo '[SCM] ')\n+emaildiff=$(git config hooks.emaildiff)\n \n # --- Main loop\n # Allow dual mode: run from the command line just like the update hook, or\n-- \n1.6.0.rc2.2.gd827\n"}]}