Subject: Re: bug#65924: git searches coreutils and util-linux commands in PATH

From: Maxim Cournoyer <[email-masked]>
Date: Wed, 04 Oct 2023 23:41:43 -0400

Hi Ludovic,

Ludovic Courtès <[email-masked]> writes:

> Hi,
>
> Maxim Cournoyer <[email-masked]> skribis:
>
>> Attempting to use git-minimal in a --pure environment, I stumbled upon:
>>
>> /gnu/store/grc79ijx09nygvjh67cpk3g405nzr801-profile/libexec/git-core/git-submodule:
>> line 7: basename: command not found
>> /gnu/store/grc79ijx09nygvjh67cpk3g405nzr801-profile/libexec/git-core/git-submodule:
>> line 7: sed: command not found
>> /gnu/store/grc79ijx09nygvjh67cpk3g405nzr801-profile/libexec/git-core/git-sh-setup:
>> line 77: basename: command not found
>> /gnu/store/grc79ijx09nygvjh67cpk3g405nzr801-profile/libexec/git-core/git-sh-setup:
>> line 77: sed: command not found
>> /gnu/store/grc79ijx09nygvjh67cpk3g405nzr801-profile/libexec/git-core/git-sh-setup:
>> line 292: uname: command not found
>> /gnu/store/grc79ijx09nygvjh67cpk3g405nzr801-profile/libexec/git-core/git-submodule:
>> line 613: sed: command not found
>> /gnu/store/grc79ijx09nygvjh67cpk3g405nzr801-profile/libexec/git-core/git-submodule:
>> line 613: cmd_: command not found
>> ☒ git clone exited 127
>>
>> The 'git' command should be wrapped to include these in its PATH.
>
> I think we should add coreutils-minimal and sed (or gash-utils?) to the
> ‘git-submodule’ wrapper that already exists.

That should work for the use case at hand, but we should scan the source
for occurrences of the tools to see if other git commands need to be
wrapped as well.  This doesn't also cover 'uname' from my report, which
should be looked into as well (when is it needed? is it a fatal error if
it's missing? etc.)

-- 
Thanks,
Maxim