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

Re: [PATCH] git-send-email: honor $PATH

From
Florian Klink <flokli@flokli.de>
Date
Nov 19, 2017, 12:35 UTC
Message-ID
<20171119123511.pck5aqak4yyc6367@tp.flokli.de>
In-Reply-To
<xmqqd14foz7p.fsf@gitster.mtv.corp.google.com>
On 17-11-19 10:04:58, Junio C Hamano wrote:
Show 16 quoted lines
>"brian m. carlson" <sandals@crustytoothpaste.net> writes:
>
>> This patch adds support for PATH, but it also removes the fixed paths.
>> On many systems, unprivileged users don't have /usr/sbin in their PATH,
>> and I know of no systems which provide /usr/lib as a PATH value.
>> Therefore, it's possible that this change will break automatic detection
>> of sendmail for many users.
>
>It is more than possible ;-) that this change alone is a regression.
>
>> I think what you probably want to do is use entries in PATH first, and
>> leave the two old values as backups at the end.
>
>I do not think it would make things worse if the change were to do
>the two standard places first and then try elements on the $PATH;
>split of $PATH needs to be done carefully (Windows?), though.

Support to detect sendmail binaries in windows' PATH seems a bit more complex. The separator is different, and PATHEXT would need to be considered too. I'm not even sure if having a sendmail binary in PATH on windows is something usual or if defaulting to smtp to localhost (what we currently do) is good enough (tm). If we want to start parsing PATH under windows too, I'd suggest to use File::Which instead of implementing it on our own.

Show 14 quoted lines
>I would feel a lot more worried about trying elements on the $PATH
>first and then using the two standard places as fallback.  If the
>order of addition matters at all, that would mean that trying
>elements on $PATH first and then falling back to the two standard
>places *will* change the behaviour---for the affected users, we used
>to pick one of these two, but now we would pick something different.
>sendmail is usually installed out of the way of $PATH for regular
>users for a reason, so picking anything whose name happens to be
>sendmail that is on $PATH does not sound right.
>
>Of course, for users who do not have sendmail at one of the two
>standard places _and_ has one on one of the directories on $PATH,
>the order in which we check would not make a difference, so my
>suggestion would be to do the other way around.

I could happily provide a patch that does it the other way round, too. But let's first decide on what to do with windows ;-)

Cheers, Florian

Previous: Junio C HamanoNext: Florian Klink
Message 6 of 9 in “git-send-email: honor $PATH”
  1. git-send-email: honor $PATHFlorian Klink, Nov 18, 2017
  2. brian m. carlsonNov 18, 2017
  3. Florian KlinkNov 18, 2017
  4. git-send-email: honor $PATH for sendmail binaryFlorian Klink, Nov 18, 2017
  5. Junio C HamanoNov 19, 2017
  6. Florian KlinkNov 19, 2017
  7. Florian KlinkNov 28, 2017
  8. git-send-email: honor $PATH for sendmail binaryFlorian Klink, Nov 28, 2017
  9. Junio C HamanoNov 28, 2017

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.