git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Florian Klink <flokli@flokli.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: "brian m. carlson" <sandals@crustytoothpaste.net>, git@vger.kernel.org
Subject: Re: [PATCH] git-send-email: honor $PATH
Date: Sun, 19 Nov 2017 13:35:11 +0100	[thread overview]
Message-ID: <20171119123511.pck5aqak4yyc6367@tp.flokli.de> (raw)
In-Reply-To: <xmqqd14foz7p.fsf@gitster.mtv.corp.google.com>

On 17-11-19 10:04:58, Junio C Hamano wrote:
>"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.

>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

  reply	other threads:[~2017-11-19 12:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-18 12:42 [PATCH] git-send-email: honor $PATH Florian Klink
2017-11-18 21:01 ` brian m. carlson
2017-11-18 21:28   ` Florian Klink
2017-11-18 22:20     ` [PATCH v2] git-send-email: honor $PATH for sendmail binary Florian Klink
2017-11-19  1:04   ` [PATCH] git-send-email: honor $PATH Junio C Hamano
2017-11-19 12:35     ` Florian Klink [this message]
2017-11-28  0:32       ` Florian Klink
2017-11-28  0:49       ` [PATCH v3] git-send-email: honor $PATH for sendmail binary Florian Klink
2017-11-28  1:13         ` 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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171119123511.pck5aqak4yyc6367@tp.flokli.de \
    --to=flokli@flokli.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=sandals@crustytoothpaste.net \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).