All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Haggerty <mhagger@alum.mit.edu>
To: Adam Mercer <ramercer@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: post-receive-email hook with custom_showrev
Date: Wed, 27 Feb 2013 08:42:14 +0100	[thread overview]
Message-ID: <512DB8D6.9010109@alum.mit.edu> (raw)
In-Reply-To: <CA+mfgz1jrSbbZc7+asxfZivemYSvbB3+UxYx4sm3BwLmR0ELEA@mail.gmail.com>

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/

  parent reply	other threads:[~2013-02-27  7:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2013-02-27 14:30   ` Adam Mercer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=512DB8D6.9010109@alum.mit.edu \
    --to=mhagger@alum.mit.edu \
    --cc=git@vger.kernel.org \
    --cc=ramercer@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.