* post-receive-email hook with custom_showrev
@ 2013-02-22 20:57 Adam Mercer
2013-02-26 1:39 ` Adam Mercer
2013-02-27 7:42 ` Michael Haggerty
0 siblings, 2 replies; 4+ messages in thread
From: Adam Mercer @ 2013-02-22 20:57 UTC (permalink / raw)
To: git
Hi
I'm trying to setup the post-receive-email hook, from contrib, using a
custom_showrev, from the script I do this by setting hooks.showrev
# hooks.showrev
# The shell command used to format each revision in the email, with
# "%s" replaced with the commit id. Defaults to "git rev-list -1
# --pretty %s", displaying the commit id, author, date and log
# message. To list full patches separated by a blank line, you
# could set this to "git show -C %s; echo".
# To list a gitweb/cgit URL *and* a full patch for each change set, use this:
# "t=%s; printf 'http://.../?id=%%s' \$t; echo;echo; git show -C \$t; echo"
# Be careful if "..." contains things that will be expanded by shell "eval"
# or printf.
in my repositories config I have showrev set to:
[hooks]
showrev = t=%s; printf
'http://server/cgit/repository/commit/?id=%%s' \$t; echo;echo; git
show -C \$t; echo
But in the emails from the post-receive-email hook I get something like:
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "LALSuite".
The branch, master has been updated
via 10f97dd6db3861e35e517301f6c1dec30be90012 (commit)
from 8c7dfa89cec5ac0a5b9520967b92a927734611f0 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
-----------------------------------------------------------------------
Summary of changes:
lal/README | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
So it seems as if showrev is being ignored? Can anyone see what I'm doing wrong?
Cheers
Adam
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: post-receive-email hook with custom_showrev
2013-02-22 20:57 post-receive-email hook with custom_showrev Adam Mercer
@ 2013-02-26 1:39 ` Adam Mercer
2013-02-27 7:42 ` Michael Haggerty
1 sibling, 0 replies; 4+ messages in thread
From: Adam Mercer @ 2013-02-26 1:39 UTC (permalink / raw)
To: git
On Fri, Feb 22, 2013 at 2:57 PM, Adam Mercer <ramercer@gmail.com> wrote:
> So it seems as if showrev is being ignored? Can anyone see what I'm doing wrong?
Anyone? From looking at the documentation I can't see anything wrong
but as it's not displaying anything something is clearly wrong.
Cheers
Adam
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: post-receive-email hook with custom_showrev
2013-02-22 20:57 post-receive-email hook with custom_showrev Adam Mercer
2013-02-26 1:39 ` Adam Mercer
@ 2013-02-27 7:42 ` Michael Haggerty
2013-02-27 14:30 ` Adam Mercer
1 sibling, 1 reply; 4+ messages in thread
From: Michael Haggerty @ 2013-02-27 7:42 UTC (permalink / raw)
To: Adam Mercer; +Cc: git
On 02/22/2013 09:57 PM, Adam Mercer wrote:
> I'm trying to setup the post-receive-email hook, from contrib, using a
> custom_showrev, from the script I do this by setting hooks.showrev
>
> # hooks.showrev
> # The shell command used to format each revision in the email, with
> # "%s" replaced with the commit id. Defaults to "git rev-list -1
> # --pretty %s", displaying the commit id, author, date and log
> # message. To list full patches separated by a blank line, you
> # could set this to "git show -C %s; echo".
> # To list a gitweb/cgit URL *and* a full patch for each change set, use this:
> # "t=%s; printf 'http://.../?id=%%s' \$t; echo;echo; git show -C \$t; echo"
> # Be careful if "..." contains things that will be expanded by shell "eval"
> # or printf.
>
> in my repositories config I have showrev set to:
>
> [hooks]
> showrev = t=%s; printf
> 'http://server/cgit/repository/commit/?id=%%s' \$t; echo;echo; git
> show -C \$t; echo
If I type that into my .git/config file then type "git config
hooks.showrev" I get "bad config file line 7 in .git/config" due to the
"\$". I think the quoting in the comment in post-receive-email is
written as if it would be passed via the command line to "git config"; i.e.,
git config hooks.showrev "t=%s; printf 'http://.../?id=%%s' \$t;
echo;echo; git show -C \$t; echo"
Granted, the docs don't make that clear. See git-config(1) for the
details of the config file syntax.
Michael
--
Michael Haggerty
mhagger@alum.mit.edu
http://softwareswirl.blogspot.com/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: post-receive-email hook with custom_showrev
2013-02-27 7:42 ` Michael Haggerty
@ 2013-02-27 14:30 ` Adam Mercer
0 siblings, 0 replies; 4+ messages in thread
From: Adam Mercer @ 2013-02-27 14:30 UTC (permalink / raw)
To: Michael Haggerty; +Cc: git
On Wed, Feb 27, 2013 at 1:42 AM, Michael Haggerty <mhagger@alum.mit.edu> wrote:
> If I type that into my .git/config file then type "git config
> hooks.showrev" I get "bad config file line 7 in .git/config" due to the
> "\$". I think the quoting in the comment in post-receive-email is
> written as if it would be passed via the command line to "git config"; i.e.,
>
> git config hooks.showrev "t=%s; printf 'http://.../?id=%%s' \$t;
> echo;echo; git show -C \$t; echo"
>
> Granted, the docs don't make that clear. See git-config(1) for the
> details of the config file syntax.
Thanks a lot that did the trick! I imagined it'd be some quoting issue.
Cheers
Adam
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-02-27 14:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-22 20:57 post-receive-email hook with custom_showrev Adam Mercer
2013-02-26 1:39 ` Adam Mercer
2013-02-27 7:42 ` Michael Haggerty
2013-02-27 14:30 ` Adam Mercer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).