Re: [PATCH 1/3] var: add support for listing the shell
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 22, 2023, 21:41 UTC
- Message-ID
- <xmqq4jmzdvkh.fsf@gitster.g>
- In-Reply-To
- <ZJS8Ot+dHDRXZD/t@tapette.crustytoothpaste.net>
"brian m. carlson" <sandals@crustytoothpaste.net> writes:
Show 17 quoted lines
> On 2023-06-22 at 21:05:39, Junio C Hamano wrote:
>> Correct. I also suspect that we want to add test_path_is_executable
>> helper next to test_path_is_{file,dir,missing} helpers and list it
>> in t/README. One downside of your approach is that the output from
>> the command is only in $shpath and cannot be observed easily in the
>> $TRASH_DIRECTORY after the test fails, but with such a helper we can
>> report the problematic path when the expectation fails.
>
> At first glance, I thought that was a good idea, too, but unfortunately
> there is no way to make that work on Windows. That's why all of our
> tests skip those assertions with POSIXPERM, and why my tests
> specifically look for something different on Windows.
>
> We could in theory just make it always succeed there, but my concern
> with writing such a function is that people will think it works
> generally, when in fact it does not. That's why, typically throughout
> the codebase, we specifically use "test -x".Hmph. I would have thought that test_path_is_executable that is based on "test -x" and gives a diagnosis when "test -x" fails would be better than using bare "test -x" and be silent, even on Windows.