Re: [PATCH v2 3/3] t9164: fix inability to find basename(1) in hooks
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Nov 9, 2023, 07:02 UTC
- Message-ID
- <ZUyD9Z9tsq9O2IkU@tanuki>
- In-Reply-To
- <ZUx8adNt3Ky-U09W@tanuki>
On Thu, Nov 09, 2023 at 07:30:01AM +0100, Patrick Steinhardt wrote:
> On Thu, Nov 09, 2023 at 02:43:02AM +0900, Junio C Hamano wrote: > > Jeff King <peff@peff.net> writes:
[snip]
Show 12 quoted lines
> > By default, Subversion executes hook scripts with an empty > > environment—that is, no environment variables are set at all, not even > > $PATH (or %PATH%, under Windows). Because of this, many administrators > > are baffled when their hook program runs fine by hand, but doesn't > > work when invoked by Subversion. Administrators have historically > > worked around this problem by manually setting all the environment > > variables their hook scripts need in the scripts themselves. > > So it's not an issue of the environment, but rather an implementation > detail of how Subversion hooks work. It's surprising that this does not > fail on other platforms -- maybe the shell has a default PATH there that > allow us to locate basename(1)? I dunno.
Yup, that's in fact it. Bash falls back to a default PATH that can be queried via getconf(1p), and this works alright on most platforms. Not on NixOS though.
Patrick