Re: [PATCH 2/2] send-email: expand paths in sendemail.{to,cc}cmd config
- From
Jeff King <peff@peff.net>
- Date
- Nov 24, 2015, 22:23 UTC
- Message-ID
- <20151124222330.GF29185@sigill.intra.peff.net>
- In-Reply-To
- <20151124084353.GH21488@serenity.lan>
On Tue, Nov 24, 2015 at 08:43:53AM +0000, John Keeping wrote:
Show 16 quoted lines
> 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).
-Peff