Re: [PATCH] git-send-email: honor $PATH
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 19, 2017, 01:04 UTC
- Message-ID
- <xmqqd14foz7p.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20171118210109.ttp7bnihi3xb4xvs@genre.crustytoothpaste.net>
"brian m. carlson" <sandals@crustytoothpaste.net> writes:
Show 5 quoted lines
> 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.
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.