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

Re: [PATCH v3] git-send-email: use ! to indicate relative path to command

From
Jeff King <peff@peff.net>
Date
May 11, 2021, 19:24 UTC
Message-ID
<YJrZ7Hho6jrVyM7f@coredump.intra.peff.net>
In-Reply-To
<20210511191510.25888-1-greg@gpanders.com>
On Tue, May 11, 2021 at 01:15:11PM -0600, Gregory Anders wrote:
> When the smtpServer config option is prefixed with a ! character, the
> value of the option should be interpreted as a command to look up on
> PATH.

This tells us "what", but the commit message is a good place to describe "why". That helps reviewers now understand what you're trying to accomplish, and why this is a good way to do it rather than some other patch.

IMHO the most important "why" here is that there currently is no way to specify a local smtp server program without using a full path.

I think this is a good direction to fix it, though for anybody just seeing this patch, I'd call attention to the nearby thread (and the one it links to):

  https://lore.kernel.org/git/YJrH8uqzapnpNEsb@gpanders.com/
>  git-send-email.perl | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
We'd probably want a test here, as well; see t/t9001-send-email.sh.

We implicitly test the absolute-path behavior in that script because pass "--smtp-server=$(pwd)/fake.sendmail" in lots of places. But we'd probably want a new test block that checks that:

  PATH=$(pwd):$PATH \
  git send-email --smtp-server="!fake.sendmail"
does what you expect.
-Peff
Previous: Gregory AndersNext: Gregory Anders
Message 2 of 23 in “git-send-email: use ! to indicate relative path to command”
  1. git-send-email: use ! to indicate relative path to commandGregory Anders, May 11, 2021
  2. Jeff KingMay 11, 2021
  3. git-send-email: use ! to indicate relative path to commandGregory Anders, May 11, 2021
  4. Jeff KingMay 11, 2021
  5. Gregory AndersMay 11, 2021
  6. Junio C HamanoMay 11, 2021
  7. git-send-email: use ! to indicate relative path to commandGregory Anders, May 11, 2021
  8. brian m. carlsonMay 12, 2021
  9. Jeff KingMay 12, 2021
  10. Gregory AndersMay 12, 2021
  11. Jeff KingMay 12, 2021
  12. Junio C HamanoMay 12, 2021
  13. brian m. carlsonMay 12, 2021
  14. Felipe ContrerasMay 11, 2021
  15. Gregory AndersMay 11, 2021
  16. Felipe ContrerasMay 11, 2021
  17. Gregory AndersMay 11, 2021
  18. Jeff KingMay 12, 2021
  19. Felipe ContrerasMay 12, 2021
  20. Jeff KingMay 12, 2021
  21. Felipe ContrerasMay 12, 2021
  22. Gregory AndersMay 12, 2021
  23. Felipe ContrerasMay 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.