Re: [PATCH] git-send-email: honor $PATH
- From
brian m. carlson <sandals@crustytoothpaste.net>
- Date
- Nov 18, 2017, 21:01 UTC
- Message-ID
- <20171118210109.ttp7bnihi3xb4xvs@genre.crustytoothpaste.net>
- In-Reply-To
- <20171118124249.26479-1-flokli@flokli.de>
On Sat, Nov 18, 2017 at 01:42:49PM +0100, Florian Klink wrote:
Show 22 quoted lines
> This will search $PATH for a sendmail binary, instead of the (previously > fixed) list of paths. > > Signed-off-by: Florian Klink <flokli@flokli.de> > --- > Documentation/git-send-email.txt | 5 ++--- > git-send-email.perl | 3 ++- > 2 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt > index bac9014ac..b9b1f2c41 100644 > --- a/Documentation/git-send-email.txt > +++ b/Documentation/git-send-email.txt > @@ -203,9 +203,8 @@ a password is obtained using 'git-credential'. > specify a full pathname of a sendmail-like program instead; > the program must support the `-i` option. Default value can > be specified by the `sendemail.smtpServer` configuration > - option; the built-in default is `/usr/sbin/sendmail` or > - `/usr/lib/sendmail` if such program is available, or > - `localhost` otherwise. > + option; the built-in default is to search in $PATH if such program is > + available, or `localhost` otherwise.
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.
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.
-- brian m. carlson / brian with sandals: Houston, Texas, US https://www.crustytoothpaste.net/~bmc | My opinion only OpenPGP: https://keybase.io/bk2204