git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Syntax for specifying a command in git config

From
Jeff King <peff@peff.net>
Date
May 12, 2021, 00:32 UTC
Message-ID
<YJsiKDNbKclFU00b@coredump.intra.peff.net>
In-Reply-To
<xmqqo8dgj2vk.fsf@gitster.g>
On Wed, May 12, 2021 at 07:56:47AM +0900, Junio C Hamano wrote:
Show 17 quoted lines
> > 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. :)
> 
> The argument is not just about configuration but applies equally to
> its command line argument "--smtp-server=<what>", right?  I think it
> makes sense in both of these places.  I further wonder if we should
> allow not just a single token, but supplying an initial few arguments,
> too, e.g.
> 
> 	git send-email --smtp-server="/usr/bin/env msmtp"
> 	git send-email --smtp-server="!my-msa --emulate-sendmail"

Yes, the patch under discussion does apply to both the command-line option and the config option (and I agree it should).

I didn't think about arguments, but you're right that may be a useful feature. And if done via the shell, as brian suggested elsewhere, would be more consistent with other parts of Git using "!" syntax.

It does make things a little weird in that:
  git send-email --smtp-server='/path/to/my-sendmail foo'
and
  git send-email --smtp-server '!my-sendmail foo'

behave differently (the first does not work; it looks for an executable with a space in the name).

-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 5 in “Syntax for specifying a command in git config”
  1. Gregory AndersMay 11, 2021
  2. Jeff KingMay 11, 2021
  3. Junio C HamanoMay 11, 2021
  4. Jeff KingMay 12, 2021
  5. Junio C HamanoMay 12, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.