{"thread":{"id":"32978","subject":"post-receive-email hook with custom_showrev","startedAt":"2013-02-22T20:57:41Z","lastAt":"2013-02-27T14:30:29Z","messageCount":4,"participants":["Adam Mercer","Michael Haggerty"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"210056","messageId":"CA+mfgz1jrSbbZc7+asxfZivemYSvbB3+UxYx4sm3BwLmR0ELEA@mail.gmail.com","threadId":"32978","inReplyTo":null,"subject":"post-receive-email hook with custom_showrev","fromName":"Adam Mercer","fromEmail":"ramercer@gmail.com","sentAt":"2013-02-22T20:57:41Z","receivedAt":"2013-02-22T20:57:41Z","isPatch":false,"sender":{"key":"ramercer@gmail.com","avatar":"https://gravatar.com/avatar/16dc719817f62b75075d529ce4ea992ee82bb1a08e45a3029797f39223d6ee64?d=mp&s=160"},"body":"Hi\n\nI'm trying to setup the post-receive-email hook, from contrib, using a\ncustom_showrev, from the script I do this by setting hooks.showrev\n\n# hooks.showrev\n#   The shell command used to format each revision in the email, with\n#   \"%s\" replaced with the commit id.  Defaults to \"git rev-list -1\n#   --pretty %s\", displaying the commit id, author, date and log\n#   message.  To list full patches separated by a blank line, you\n#   could set this to \"git show -C %s; echo\".\n#   To list a gitweb/cgit URL *and* a full patch for each change set, use this:\n#     \"t=%s; printf 'http://.../?id=%%s' \\$t; echo;echo; git show -C \\$t; echo\"\n#   Be careful if \"...\" contains things that will be expanded by shell \"eval\"\n#   or printf.\n\nin my repositories config I have showrev set to:\n\n[hooks]\n        showrev = t=%s; printf\n'http://server/cgit/repository/commit/?id=%%s' \\$t; echo;echo; git\nshow -C \\$t; echo\n\nBut in the emails from the post-receive-email hook I get something like:\n\nThis is an automated email from the git hooks/post-receive script. It was\ngenerated because a ref change was pushed to the repository containing\nthe project \"LALSuite\".\n\nThe branch, master has been updated\n       via  10f97dd6db3861e35e517301f6c1dec30be90012 (commit)\n      from  8c7dfa89cec5ac0a5b9520967b92a927734611f0 (commit)\n\nThose revisions listed above that are new to this repository have\nnot appeared on any other notification email; so we list those\nrevisions in full, below.\n\n- Log -----------------------------------------------------------------\n-----------------------------------------------------------------------\n\nSummary of changes:\n lal/README |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\nSo it seems as if showrev is being ignored? Can anyone see what I'm doing wrong?\n\nCheers\n\nAdam\n"},{"id":"210312","messageId":"CA+mfgz3j7sbqOHOZkBm+dH08+QmyerGeVLLPnF2LeYn=y_Qs1Q@mail.gmail.com","threadId":"32978","inReplyTo":"CA+mfgz1jrSbbZc7+asxfZivemYSvbB3+UxYx4sm3BwLmR0ELEA@mail.gmail.com","subject":"Re: post-receive-email hook with custom_showrev","fromName":"Adam Mercer","fromEmail":"ramercer@gmail.com","sentAt":"2013-02-26T01:39:44Z","receivedAt":"2013-02-26T01:39:44Z","isPatch":false,"sender":{"key":"ramercer@gmail.com","avatar":"https://gravatar.com/avatar/16dc719817f62b75075d529ce4ea992ee82bb1a08e45a3029797f39223d6ee64?d=mp&s=160"},"body":"On Fri, Feb 22, 2013 at 2:57 PM, Adam Mercer <ramercer@gmail.com> wrote:\n\n> So it seems as if showrev is being ignored? Can anyone see what I'm doing wrong?\n\nAnyone? From looking at the documentation I can't see anything wrong\nbut as it's not displaying anything something is clearly wrong.\n\nCheers\n\nAdam\n"},{"id":"210384","messageId":"512DB8D6.9010109@alum.mit.edu","threadId":"32978","inReplyTo":"CA+mfgz1jrSbbZc7+asxfZivemYSvbB3+UxYx4sm3BwLmR0ELEA@mail.gmail.com","subject":"Re: post-receive-email hook with custom_showrev","fromName":"Michael Haggerty","fromEmail":"mhagger@alum.mit.edu","sentAt":"2013-02-27T07:42:14Z","receivedAt":"2013-02-27T07:42:14Z","isPatch":false,"sender":{"key":"mhagger@alum.mit.edu","avatar":"https://avatars.githubusercontent.com/u/119718?v=4"},"body":"On 02/22/2013 09:57 PM, Adam Mercer wrote:\n> I'm trying to setup the post-receive-email hook, from contrib, using a\n> custom_showrev, from the script I do this by setting hooks.showrev\n> \n> # hooks.showrev\n> #   The shell command used to format each revision in the email, with\n> #   \"%s\" replaced with the commit id.  Defaults to \"git rev-list -1\n> #   --pretty %s\", displaying the commit id, author, date and log\n> #   message.  To list full patches separated by a blank line, you\n> #   could set this to \"git show -C %s; echo\".\n> #   To list a gitweb/cgit URL *and* a full patch for each change set, use this:\n> #     \"t=%s; printf 'http://.../?id=%%s' \\$t; echo;echo; git show -C \\$t; echo\"\n> #   Be careful if \"...\" contains things that will be expanded by shell \"eval\"\n> #   or printf.\n> \n> in my repositories config I have showrev set to:\n> \n> [hooks]\n>         showrev = t=%s; printf\n> 'http://server/cgit/repository/commit/?id=%%s' \\$t; echo;echo; git\n> show -C \\$t; echo\n\nIf I type that into my .git/config file then type \"git config\nhooks.showrev\" I get \"bad config file line 7 in .git/config\" due to the\n\"\\$\".  I think the quoting in the comment in post-receive-email is\nwritten as if it would be passed via the command line to \"git config\"; i.e.,\n\n    git config hooks.showrev \"t=%s; printf 'http://.../?id=%%s' \\$t;\necho;echo; git show -C \\$t; echo\"\n\nGranted, the docs don't make that clear.  See git-config(1) for the\ndetails of the config file syntax.\n\nMichael\n\n-- \nMichael Haggerty\nmhagger@alum.mit.edu\nhttp://softwareswirl.blogspot.com/\n"},{"id":"210394","messageId":"CA+mfgz3XsVB9hk+0rG0VnJQL9P9oD-wrrTX35xpsF2kM9GqJMQ@mail.gmail.com","threadId":"32978","inReplyTo":"512DB8D6.9010109@alum.mit.edu","subject":"Re: post-receive-email hook with custom_showrev","fromName":"Adam Mercer","fromEmail":"ramercer@gmail.com","sentAt":"2013-02-27T14:30:29Z","receivedAt":"2013-02-27T14:30:29Z","isPatch":false,"sender":{"key":"ramercer@gmail.com","avatar":"https://gravatar.com/avatar/16dc719817f62b75075d529ce4ea992ee82bb1a08e45a3029797f39223d6ee64?d=mp&s=160"},"body":"On Wed, Feb 27, 2013 at 1:42 AM, Michael Haggerty <mhagger@alum.mit.edu> wrote:\n\n> If I type that into my .git/config file then type \"git config\n> hooks.showrev\" I get \"bad config file line 7 in .git/config\" due to the\n> \"\\$\".  I think the quoting in the comment in post-receive-email is\n> written as if it would be passed via the command line to \"git config\"; i.e.,\n>\n>     git config hooks.showrev \"t=%s; printf 'http://.../?id=%%s' \\$t;\n> echo;echo; git show -C \\$t; echo\"\n>\n> Granted, the docs don't make that clear.  See git-config(1) for the\n> details of the config file syntax.\n\nThanks a lot that did the trick! I imagined it'd be some quoting issue.\n\nCheers\n\nAdam\n"}]}