{"thread":{"id":"8598","subject":"[PATCH] post-receive-email hook: handle order of arguments consistently","startedAt":"2007-06-14T09:09:29Z","lastAt":"2007-08-07T17:38:15Z","messageCount":4,"participants":["Gerrit Pape","Andy Parkins"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"45056","messageId":"20070614090929.31616.qmail@c76df6d65db410.315fe32.mid.smarden.org","threadId":"8598","inReplyTo":null,"subject":"[PATCH] post-receive-email hook: handle order of arguments consistently","fromName":"Gerrit Pape","fromEmail":"pape@smarden.org","sentAt":"2007-06-14T09:09:29Z","receivedAt":"2007-06-14T09:09:29Z","isPatch":true,"sender":{"key":"pape@smarden.org","avatar":"https://avatars.githubusercontent.com/u/143170252?v=4"},"body":"The post-receive-email hook usually gets its arguments through stdin, but\nalso supports them to be specified at the command line.  The order of the\narguments should consistently follow the documentation no matter how they\nare passed to the script.\n\nThis was noticed and suggested by martin f krafft through\n http://bugs.debian.org/428413\n\nSigned-off-by: Gerrit Pape <pape@smarden.org>\n---\n contrib/hooks/post-receive-email |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/contrib/hooks/post-receive-email b/contrib/hooks/post-receive-email\nindex c589a39..f84532f 100644\n--- a/contrib/hooks/post-receive-email\n+++ b/contrib/hooks/post-receive-email\n@@ -605,7 +605,7 @@ envelopesender=$(git-repo-config hooks.envelopesender)\n if [ -n \"$1\" -a -n \"$2\" -a -n \"$3\" ]; then\n \t# Output to the terminal in command line mode - if someone wanted to\n \t# resend an email; they could redirect the output to sendmail themselves\n-\tPAGER= generate_email $2 $3 $1\n+\tPAGER= generate_email $1 $2 $3\n else\n \tif [ -n \"$envelopesender\" ]; then\n \t\tenvelopesender=\"-f '$envelopesender'\"\n-- \n1.5.2.1\n"},{"id":"45059","messageId":"200706141119.18724.andyparkins@gmail.com","threadId":"8598","inReplyTo":"20070614090929.31616.qmail@c76df6d65db410.315fe32.mid.smarden.org","subject":"Re: [PATCH] post-receive-email hook: handle order of arguments consistently","fromName":"Andy Parkins","fromEmail":"andyparkins@gmail.com","sentAt":"2007-06-14T10:19:17Z","receivedAt":"2007-06-14T10:19:17Z","isPatch":true,"sender":{"key":"andyparkins@gmail.com","avatar":null},"body":"On Thursday 2007 June 14, Gerrit Pape wrote:\n> The post-receive-email hook usually gets its arguments through stdin, but\n> also supports them to be specified at the command line.  The order of the\n> arguments should consistently follow the documentation no matter how they\n> are passed to the script.\n\nThat wasn't done casually.  It was done so that the same script would work as \nan update hook as well.\n\nI have no objection to the change, as the update hook was not the right place \nfor generating emails.  However, it let me use that same update hook on a \nsystem that did not have a git with support for the post-receive hook.\n\n\nAndy\n-- \nDr Andy Parkins, M Eng (hons), MIET\nandyparkins@gmail.com\n"},{"id":"50129","messageId":"20070807135849.24926.qmail@49810ee852ce6e.315fe32.mid.smarden.org","threadId":"8598","inReplyTo":"200706141119.18724.andyparkins@gmail.com","subject":"[PATCH] post-receive-email hook: handle order of arguments consistently","fromName":"Gerrit Pape","fromEmail":"pape@smarden.org","sentAt":"2007-08-07T13:58:49Z","receivedAt":"2007-08-07T13:58:49Z","isPatch":true,"sender":{"key":"pape@smarden.org","avatar":"https://avatars.githubusercontent.com/u/143170252?v=4"},"body":"The post-receive-email hook usually gets its arguments through stdin,\nbut also supports them to be specified at the command line.  The order\nof the arguments should consistently follow the documentation no matter\nhow they are passed to the script.\n\nThis was noticed and suggested by martin f krafft through\n http://bugs.debian.org/428413\n\nSigned-off-by: Gerrit Pape <pape@smarden.org>\n---\n\nOn Thu, Jun 14, 2007 at 11:19:17AM +0100, Andy Parkins wrote:\n> On Thursday 2007 June 14, Gerrit Pape wrote:\n> > The post-receive-email hook usually gets its arguments through stdin, but\n> > also supports them to be specified at the command line.  The order of the\n> > arguments should consistently follow the documentation no matter how they\n> > are passed to the script.\n> \n> That wasn't done casually.  It was done so that the same script would work as \n> an update hook as well.\n> \n> I have no objection to the change, as the update hook was not the right place \n> for generating emails.  However, it let me use that same update hook on a \n> system that did not have a git with support for the post-receive hook.\n\nHi, I suggest to apply this patch for 1.5.3.  Thanks, Gerrit.\n\n\n contrib/hooks/post-receive-email |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/contrib/hooks/post-receive-email b/contrib/hooks/post-receive-email\nindex c589a39..f84532f 100644\n--- a/contrib/hooks/post-receive-email\n+++ b/contrib/hooks/post-receive-email\n@@ -605,7 +605,7 @@ envelopesender=$(git-repo-config hooks.envelopesender)\n if [ -n \"$1\" -a -n \"$2\" -a -n \"$3\" ]; then\n \t# Output to the terminal in command line mode - if someone wanted to\n \t# resend an email; they could redirect the output to sendmail themselves\n-\tPAGER= generate_email $2 $3 $1\n+\tPAGER= generate_email $1 $2 $3\n else\n \tif [ -n \"$envelopesender\" ]; then\n \t\tenvelopesender=\"-f '$envelopesender'\"\n-- \n1.5.3.GIT\n"},{"id":"50138","messageId":"200708071838.17999.andyparkins@gmail.com","threadId":"8598","inReplyTo":"20070807135849.24926.qmail@49810ee852ce6e.315fe32.mid.smarden.org","subject":"Re: [PATCH] post-receive-email hook: handle order of arguments consistently","fromName":"Andy Parkins","fromEmail":"andyparkins@gmail.com","sentAt":"2007-08-07T17:38:15Z","receivedAt":"2007-08-07T17:38:15Z","isPatch":true,"sender":{"key":"andyparkins@gmail.com","avatar":null},"body":"On Tuesday 2007, August 07, Gerrit Pape wrote:\n> The post-receive-email hook usually gets its arguments through stdin,\n> but also supports them to be specified at the command line.  The order\n> of the arguments should consistently follow the documentation no matter\n> how they are passed to the script.\n\n\nAs I said the last time this was posted, this was done on purpose so that \nthe command line arguments match the order of the arguments to the update \nhook.\n\nKeeping them in that order allows the script to be used as an update hook in \nolder versions of git.\n\nWhether that is sensible or not is for Junio and the gang to decide; but \nthere was good reason for doing it that way.  Also, I'm not sure what \ndocumentation you're talking about - use in command line mode is a bonus \nfeature anyway, it's not necessary in normal hook mode anyway.  If you're \ngoing to be strict about matching documentation then the command line mode \nshould be removed.\n\n\n\nAndy\n\n-- \nDr Andy Parkins, M Eng (hons), MIET\nandyparkins@gmail.com\n"}]}