git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Keeping <john@keeping.me.uk>
To: Jeff King <peff@peff.net>
Cc: Eric Sunshine <sunshine@sunshineco.com>, Git List <git@vger.kernel.org>
Subject: Re: [PATCH 2/2] send-email: expand paths in sendemail.{to,cc}cmd config
Date: Tue, 24 Nov 2015 22:58:24 +0000	[thread overview]
Message-ID: <20151124225824.GB18913@serenity.lan> (raw)
In-Reply-To: <20151124222330.GF29185@sigill.intra.peff.net>

On Tue, Nov 24, 2015 at 05:23:30PM -0500, Jeff King wrote:
> On Tue, Nov 24, 2015 at 08:43:53AM +0000, John Keeping wrote:
> 
> > On Mon, Nov 23, 2015 at 07:04:46PM -0500, Eric Sunshine wrote:
> > > On Tue, Nov 17, 2015 at 5:01 PM, John Keeping <john@keeping.me.uk> wrote:
> > > > These configuration variables specify the paths to commands so we should
> > > > support tilde-expansion for files inside a user's home directory.
> > > 
> > > Hmm, I don't see anything in the documentation which says that these
> > > are paths to commands, and the code itself treats them purely as
> > > commands to be invoked, not as paths to commands. What is the
> > > behavior, for instance, with --tocmd='foobar -x zopp' or even
> > > --tocmd='foobar -x ~/zopp'?
> > 
> > The path behaviour only expands leading '~' and '~user' (as documented
> > in git-config(1)):
> > 
> > 	$ git -c sendemail.tocmd='foobar -x ~/zopp' config --path sendemail.tocmd
> > 	foobar -x ~/zopp
> 
> We usually run user-supplied commands with a shell (and AFAICT, that is
> the case here). So wouldn't that turn into (when used by send-email):
> 
>   sh -c 'foobar -x ~/zopp'
> 
> and the shell would expand it for us? Running:
> 
>   git -c sendemail.tocmd='echo ~/foo' send-email -1
> 
> seems to work for me (it puts "/home/peff/foo" into the "to" header).

Ah, I hadn't tested it.  We can drop this patch then.

      reply	other threads:[~2015-11-24 22:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-17 22:01 [PATCH 0/2] send-email config path expansion John Keeping
2015-11-17 22:01 ` [PATCH 1/2] send-email: expand path in sendemail.smtpsslcertpath config John Keeping
2015-11-17 22:01 ` [PATCH 2/2] send-email: expand paths in sendemail.{to,cc}cmd config John Keeping
2015-11-24  0:04   ` Eric Sunshine
2015-11-24  8:43     ` John Keeping
2015-11-24 22:23       ` Jeff King
2015-11-24 22:58         ` John Keeping [this message]

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=20151124225824.GB18913@serenity.lan \
    --to=john@keeping.me.uk \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    --cc=sunshine@sunshineco.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 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).