From: Jeff King <peff@peff.net>
To: Gregory Anders <greg@gpanders.com>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: Syntax for specifying a command in git config
Date: Tue, 11 May 2021 14:17:08 -0400 [thread overview]
Message-ID: <YJrKJAa45mNIL+rf@coredump.intra.peff.net> (raw)
In-Reply-To: <YJrH8uqzapnpNEsb@gpanders.com>
On Tue, May 11, 2021 at 12:07:46PM -0600, Gregory Anders wrote:
> Certain git config parameters (notably sendemail.smtpServer) expect an
> absolute path in order to use a command. If the value begins with a / git
> interprets it as a command; otherwise, it's interpreted it as a server
> hostname.
>
> Using an absolute path is not very portable, however. If I want to have a
> common shared config file across multiple machines, each of which uses a
> command for smtpServer (e.g. msmtp) but installed at different locations, I
> have to modify the config file on each machine to update the absolute path.
>
> Obviously this is not a *huge* deal, but it is a minor annoyance. I'm
> wondering if it would be possible to add a new syntax to config options like
> this. For example,
>
> [sendemail]
> smtpServer = !msmtp
>
> The leading ! character says "the following value is a command that should
> be looked up in PATH". This is congruent with alias definitions, where the
> leading ! means to run the following value as a command directly instead of
> as a git subcommand.
>
> This also is unambiguous since server hostnames will never begin with a !
> character.
IMHO this is a good path forward. There's a thread from a few months ago
which talks about this idea:
https://lore.kernel.org/git/YCvotU6KVruFuf9%2F@coredump.intra.peff.net/
There's some back and forth, and I'm not sure if I convinced Junio in
the end. But certainly a patch would be a good way to restart the
conversation. :)
-Peff
next prev parent reply other threads:[~2021-05-11 18:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-11 18:07 Syntax for specifying a command in git config Gregory Anders
2021-05-11 18:17 ` Jeff King [this message]
2021-05-11 22:56 ` Junio C Hamano
2021-05-12 0:32 ` Jeff King
2021-05-12 3:25 ` Junio C Hamano
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=YJrKJAa45mNIL+rf@coredump.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=greg@gpanders.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).