git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] t1800: correct test to handle Cygwin

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Sep 2, 2022, 12:22 UTC
Message-ID
<4s7o04s9-3052-rqq6-584n-978p9758p580@tzk.qr>
In-Reply-To
<20220901173942.abolcr4aa5gixncm@lucy.dinwoodie.org>
Hi Adam,
On Thu, 1 Sep 2022, Adam Dinwoodie wrote:
> On Cygwin, when failing to spawn a process using start_command, Git
> outputs the same error as on Linux systems, rather than using the
> GIT_WINDOWS_NATIVE-specific error output.
Given this explanation, I would have expected...
Show 26 quoted lines
> The WINDOWS test prerequisite is set in both Cygwin and native Windows
> environments, which means it's not appropriate to use to anticipate the
> error output from start_command.  Instead, use the MINGW test
> prerequisite, which is only set for Git in native Windows environments,
> and not for Cygwin.
>
> Signed-off-by: Adam Dinwoodie <adam@dinwoodie.org>
> ---
>
> The job of setting Cygwin up to get Git CI builds, either as part of the
> main CI builds or as something using separate automation, is rapidly
> rising up my when-I-have-the-time to-do list...
>
>  t/t1800-hook.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/t/t1800-hook.sh b/t/t1800-hook.sh
> index 64096adac7..fae8b2faf9 100755
> --- a/t/t1800-hook.sh
> +++ b/t/t1800-hook.sh
> @@ -159,7 +159,7 @@ test_expect_success 'git hook run a hook with a bad shebang' '
>  	# TODO: We should emit the same (or at least a more similar)
>  	# error on Windows and !Windows. See the OS-specific code in
>  	# start_command()
> -	if test_have_prereq !WINDOWS
> +	if test_have_prereq !MINGW

... this to be `test_have_prereq !WINDOWS || test_have_prereq CYGWIN` instead.

At least it is my understanding that Cygwin is the special case of the special case that is Windows.

That is, if most scenarios on Windows were behaving like Cygwin and the mingw-w64 build was the odd duck, I would understand to restrict this only to MINGW. But I think it is the other way around: with Cygwin, _despite_ being on Windows, we see this Linux-like behavior.

Ciao, Dscho

Show 6 quoted lines
>  	then
>  		cat >expect <<-\EOF
>  		fatal: cannot run bad-hooks/test-hook: ...
> --
> 2.37.2
>
Previous: Đoàn Trần Công DanhNext: Junio C Hamano
Message 4 of 10 in “t1800: correct test to handle Cygwin”
  1. t1800: correct test to handle CygwinAdam Dinwoodie, Sep 1, 2022
  2. Junio C HamanoSep 1, 2022
  3. Đoàn Trần Công DanhSep 2, 2022
  4. Johannes SchindelinSep 2, 2022
  5. Junio C HamanoSep 7, 2022
  6. rsbecker@nexbridge.comSep 7, 2022
  7. Adam DinwoodieSep 13, 2022
  8. Junio C HamanoSep 13, 2022
  9. t1800: correct test to handle CygwinAdam Dinwoodie, Sep 15, 2022
  10. rsbecker@nexbridge.comSep 15, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.