{"thread":{"id":"16289","subject":"[PATCH] contrib/hooks/post-receive-email: send individual mails to recipients","startedAt":"2008-11-12T16:21:27Z","lastAt":"2008-11-12T22:21:23Z","messageCount":5,"participants":["Michael Adam","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"95579","messageId":"E1L0ITB-00Bv9t-72@intern.SerNet.DE","threadId":"16289","inReplyTo":null,"subject":"[PATCH] contrib/hooks/post-receive-email: send individual mails to recipients","fromName":"Michael Adam","fromEmail":"obnox@samba.org","sentAt":"2008-11-12T16:21:27Z","receivedAt":"2008-11-12T16:21:27Z","isPatch":true,"sender":{"key":"obnox@samba.org","avatar":"https://gravatar.com/avatar/5318dd087ca600cb3218a415d282e1615817cbfc2cc9eaf00da4b9237554701b?d=mp&s=160"},"body":"This changes the behaviour of post-receive-email when a list of recipients\n(separated by commas) is specified as hooks.mailinglist. With this modification,\nan individual mail is sent out for each recipient entry in the list, instead\nof sending a single mail with all the recipients in the \"To: \" field.\n\nSigned-off-by: Michael Adam <obnox@samba.org>\n---\n contrib/hooks/post-receive-email |   30 +++++++++++++++++-------------\n 1 files changed, 17 insertions(+), 13 deletions(-)\n\ndiff --git a/contrib/hooks/post-receive-email b/contrib/hooks/post-receive-email\nindex 28a3c0e..5deaf28 100644\n--- a/contrib/hooks/post-receive-email\n+++ b/contrib/hooks/post-receive-email\n@@ -169,21 +169,25 @@ generate_email()\n \t\tdescribe=$rev\n \tfi\n \n-\tgenerate_email_header\n+\t# loop over the recipients to send individual mails\n+\techo $recipients | sed -e 's/\\s*,\\s*/\\n/' | while read recipient\n+\tdo\n+\t\tgenerate_email_header\n \n-\t# Call the correct body generation function\n-\tfn_name=general\n-\tcase \"$refname_type\" in\n-\t\"tracking branch\"|branch)\n-\t\tfn_name=branch\n-\t\t;;\n-\t\"annotated tag\")\n-\t\tfn_name=atag\n-\t\t;;\n-\tesac\n-\tgenerate_${change_type}_${fn_name}_email\n+\t\t# Call the correct body generation function\n+\t\tfn_name=general\n+\t\tcase \"$refname_type\" in\n+\t\t\"tracking branch\"|branch)\n+\t\t\tfn_name=branch\n+\t\t\t;;\n+\t\t\"annotated tag\")\n+\t\t\tfn_name=atag\n+\t\t\t;;\n+\t\tesac\n+\t\tgenerate_${change_type}_${fn_name}_email\n \n-\tgenerate_email_footer\n+\t\tgenerate_email_footer\n+\tdone\n }\n \n generate_email_header()\n-- \n1.5.6\n"},{"id":"95596","messageId":"7vfxlwq1gn.fsf@gitster.siamese.dyndns.org","threadId":"16289","inReplyTo":"E1L0ITB-00Bv9t-72@intern.SerNet.DE","subject":"Re: [PATCH] contrib/hooks/post-receive-email: send individual mails to recipients","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-11-12T17:49:12Z","receivedAt":"2008-11-12T17:49:12Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michael Adam <obnox@samba.org> writes:\n\n> This changes the behaviour of post-receive-email when a list of recipients\n> (separated by commas) is specified as hooks.mailinglist. With this modification,\n> an individual mail is sent out for each recipient entry in the list, instead\n> of sending a single mail with all the recipients in the \"To: \" field.\n\nWhy can that be an improvement?\n"},{"id":"95598","messageId":"E1L0Jyh-00Bzdi-7r@intern.SerNet.DE","threadId":"16289","inReplyTo":"7vfxlwq1gn.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] contrib/hooks/post-receive-email: send individual mails to recipients","fromName":"Michael Adam","fromEmail":"obnox@samba.org","sentAt":"2008-11-12T17:58:07Z","receivedAt":"2008-11-12T17:58:07Z","isPatch":true,"sender":{"key":"obnox@samba.org","avatar":"https://gravatar.com/avatar/5318dd087ca600cb3218a415d282e1615817cbfc2cc9eaf00da4b9237554701b?d=mp&s=160"},"body":"Junio C Hamano wrote:\n> Michael Adam <obnox@samba.org> writes:\n> \n> > This changes the behaviour of post-receive-email when a list of recipients\n> > (separated by commas) is specified as hooks.mailinglist. With this modification,\n> > an individual mail is sent out for each recipient entry in the list, instead\n> > of sending a single mail with all the recipients in the \"To: \" field.\n> \n> Why can that be an improvement?\n\nMy use case is that I have a repository where I want to send\ncommit messages to an \"official\" mailing list and to a private\nrecipient list that might not want to be seen on the official\nmailing list.\n\nIf this is not generally useful, I could make it optional or\nadd s/th like a secondary mailing list argument to hooks.\n\nCheers - Michael\n\n"},{"id":"95610","messageId":"7v3ahwq043.fsf@gitster.siamese.dyndns.org","threadId":"16289","inReplyTo":"E1L0Jyh-00Bzdi-7r@intern.SerNet.DE","subject":"Re: [PATCH] contrib/hooks/post-receive-email: send individual mails to recipients","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-11-12T18:18:20Z","receivedAt":"2008-11-12T18:18:20Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michael Adam <obnox@samba.org> writes:\n\n> Junio C Hamano wrote:\n>> Michael Adam <obnox@samba.org> writes:\n>> \n>> > This changes the behaviour of post-receive-email when a list of recipients\n>> > (separated by commas) is specified as hooks.mailinglist. With this modification,\n>> > an individual mail is sent out for each recipient entry in the list, instead\n>> > of sending a single mail with all the recipients in the \"To: \" field.\n>> \n>> Why can that be an improvement?\n>\n> My use case is that I have a repository where I want to send\n> commit messages to an \"official\" mailing list and to a private\n> recipient list that might not want to be seen on the official\n> mailing list.\n\nAh.  What you want is a capability to add Bcc:, not a misfeature to run\nthe log formatter repeatedly wasting cycles only to generate the same\nmessage contents.\n"},{"id":"95633","messageId":"E1L0O5U-00CBIw-3Y@intern.SerNet.DE","threadId":"16289","inReplyTo":"7v3ahwq043.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] contrib/hooks/post-receive-email: send individual mails to recipients","fromName":"Michael Adam","fromEmail":"obnox@samba.org","sentAt":"2008-11-12T22:21:23Z","receivedAt":"2008-11-12T22:21:23Z","isPatch":true,"sender":{"key":"obnox@samba.org","avatar":"https://gravatar.com/avatar/5318dd087ca600cb3218a415d282e1615817cbfc2cc9eaf00da4b9237554701b?d=mp&s=160"},"body":"Junio C Hamano wrote:\n> Michael Adam <obnox@samba.org> writes:\n> \n> > Junio C Hamano wrote:\n> >> Michael Adam <obnox@samba.org> writes:\n> >> \n> >> > This changes the behaviour of post-receive-email when a list of recipients\n> >> > (separated by commas) is specified as hooks.mailinglist. With this modification,\n> >> > an individual mail is sent out for each recipient entry in the list, instead\n> >> > of sending a single mail with all the recipients in the \"To: \" field.\n> >> \n> >> Why can that be an improvement?\n> >\n> > My use case is that I have a repository where I want to send\n> > commit messages to an \"official\" mailing list and to a private\n> > recipient list that might not want to be seen on the official\n> > mailing list.\n> \n> Ah.  What you want is a capability to add Bcc:, not a misfeature to run\n> the log formatter repeatedly wasting cycles only to generate the same\n> message contents.\n\nThe intent was to send out the mail not to a (large) list of\nindividual recipients but to some (few) mailing lists separately.\nA Bcc would be a partial solution. I also thought about that, but\nI did not like it since it might make those recipients in the bcc\nfield feel strange because they seem to be getting mail from a\nlist they might not be subscribed to. Group-replying to such\nmails may also cause confusion...\n\nOf course my patch could be optimized for not wasting cycles by\nonly running generate_email_header() multiple times and caching\nthe results of the log formatter and generate_email_footer().\n\nBut I understand that my problem is a very specific one and that\ngenerally no benefit but only disadvantage is seen in the\nmodification I suggested.  --  Sorry for the noise. :-)\n\nCheers - Michael\n"}]}