{"thread":{"id":"10684","subject":"[PATCH] contrib/hooks/post-receive-email: make subject prefix configurable","startedAt":"2007-11-06T13:49:30Z","lastAt":"2007-11-06T13:49:30Z","messageCount":1,"participants":["Gerrit Pape"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"58543","messageId":"20071106134930.24454.qmail@2bdebc2f326342.315fe32.mid.smarden.org","threadId":"10684","inReplyTo":null,"subject":"[PATCH] contrib/hooks/post-receive-email: make subject prefix configurable","fromName":"Gerrit Pape","fromEmail":"pape@smarden.org","sentAt":"2007-11-06T13:49:30Z","receivedAt":"2007-11-06T13:49:30Z","isPatch":true,"sender":{"key":"pape@smarden.org","avatar":"https://avatars.githubusercontent.com/u/143170252?v=4"},"body":"Email subjects are prefixed with \"[SCM] \" by default, make this optionally\nconfigurable through the hooks.emailprefix config option.\n\nSuggested by martin f krafft through\n http://bugs.debian.org/428418\n\nSigned-off-by: Gerrit Pape <pape@smarden.org>\n---\n contrib/hooks/post-receive-email |    8 +++++---\n 1 files changed, 5 insertions(+), 3 deletions(-)\n\ndiff --git a/contrib/hooks/post-receive-email b/contrib/hooks/post-receive-email\nindex 9b9a977..3904c18 100644\n--- a/contrib/hooks/post-receive-email\n+++ b/contrib/hooks/post-receive-email\n@@ -35,10 +35,12 @@\n # hooks.envelopesender\n #   If set then the -f option is passed to sendmail to allow the envelope\n #   sender address to be set\n+# hooks.emailprefix\n+#   All emails have their subjects prefixed with this prefix, or \"[SCM]\"\n+#   if emailprefix is unset, to aid filtering\n #\n # Notes\n # -----\n-# All emails have their subjects prefixed with \"[SCM]\" to aid filtering.\n # All emails include the headers \"X-Git-Refname\", \"X-Git-Oldrev\",\n # \"X-Git-Newrev\", and \"X-Git-Reftype\" to enable fine tuned filtering and\n # give information for debugging.\n@@ -188,7 +190,7 @@ generate_email_header()\n \t# Generate header\n \tcat <<-EOF\n \tTo: $recipients\n-\tSubject: ${EMAILPREFIX}$projectdesc $refname_type, $short_refname, ${change_type}d. $describe\n+\tSubject: ${emailprefix}$projectdesc $refname_type, $short_refname, ${change_type}d. $describe\n \tX-Git-Refname: $refname\n \tX-Git-Reftype: $refname_type\n \tX-Git-Oldrev: $oldrev\n@@ -604,7 +606,6 @@ send_mail()\n # ---------------------------- main()\n \n # --- Constants\n-EMAILPREFIX=\"[SCM] \"\n LOGBEGIN=\"- Log -----------------------------------------------------------------\"\n LOGEND=\"-----------------------------------------------------------------------\"\n \n@@ -628,6 +629,7 @@ fi\n recipients=$(git repo-config hooks.mailinglist)\n announcerecipients=$(git repo-config hooks.announcelist)\n envelopesender=$(git-repo-config hooks.envelopesender)\n+emailprefix=$(git-repo-config hooks.emailprefix || echo '[SCM] ')\n \n # --- Main loop\n # Allow dual mode: run from the command line just like the update hook, or\n-- \n1.5.3.5\n"}]}