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

Re: git-send-email: smtpserver in $HOME

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 16, 2021, 18:57 UTC
Message-ID
<xmqq35xvrgbg.fsf@gitster.c.googlers.com>
In-Reply-To
<YCvotU6KVruFuf9/@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
> Still, it seems a bit unusual for an executed program to handle tilde
> like this. The usual mechanism is for us to run it with the shell and
> expect to find it in $PATH.
Yes, the user should be able to deal with the $PATH.
> It looks like there's some weirdness here, though; $smtp_server may be a
> hostname, and it looks like we use "/" to distinguish a file path. I
> wonder if allowing "!my-sendmail" would be more consistent with other
> parts of Git (not to mention more flexible).
I am not sure '!' prefix fits well here.

When cloning from something (that is not yet known as an entity that we must go over the network), we do an equivalent of "test -f" (for bundles) and "test -d" (for local repositories), and I think the use of "does it refer to a local file" here matches it as a precedent.

I do find it sloppy that the check uses file_name_is_absolute() that only checks the shape of the string, without seeing if it actually exists and is an executable file, though.

Thanks.
Previous: Jeff KingNext: Jeff King
Message 9 of 13 in “git-send-email: smtpserver in $HOME”
  1. Jan “Khardix” StaněkFeb 15, 2021
  2. Junio C HamanoFeb 16, 2021
  3. Jan “Khardix” StaněkFeb 16, 2021
  4. Junio C HamanoFeb 16, 2021
  5. Jan “Khardix” StaněkFeb 16, 2021
  6. Chris TorekFeb 18, 2021
  7. Andreas SchwabFeb 18, 2021
  8. Jeff KingFeb 16, 2021
  9. Junio C HamanoFeb 16, 2021
  10. Jeff KingFeb 16, 2021
  11. Junio C HamanoFeb 16, 2021
  12. Jeff KingFeb 16, 2021
  13. Jan “Khardix” StaněkFeb 16, 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.