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

RE: [PATCH v2] t1800: correct test to handle Cygwin

From
rsbecker@nexbridge.com <rsbecker@nexbridge.com>
Date
Sep 15, 2022, 08:51 UTC
Message-ID
<002001d8c8e0$617c5f80$24751e80$@nexbridge.com>
In-Reply-To
<20220915075717.425673-1-adam@dinwoodie.org>
On September 15, 2022 3:57 AM, Adam Dinwoodie wrote:
Show 40 quoted lines
>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.  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>
>Helped-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
>---
>
>With apologies to folk receiving this multiple times; it looks like my SMTP setup
>was causing problems for some servers, and while the mails seemed to be arriving
>with me, they didn't seem to be appearing at
>https://public-inbox.org/git/?q=t1800
>
> t/t1800-hook.sh | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
>diff --git a/t/t1800-hook.sh b/t/t1800-hook.sh index 64096adac7..43fcb7c0bf
>100755
>--- a/t/t1800-hook.sh
>+++ b/t/t1800-hook.sh
>@@ -157,9 +157,9 @@ test_expect_success 'git hook run a hook with a bad
>shebang' '
> 	write_script bad-hooks/test-hook "/bad/path/no/spaces" </dev/null &&
>
> 	# 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
>+	# error on MINGW (essentially Git for Windows) and all other
>+	# platforms.. See the OS-specific code in start_command()
>+	if test_have_prereq !MINGW
> 	then
> 		cat >expect <<-\EOF
> 		fatal: cannot run bad-hooks/test-hook: ...
>--
>2.34.1
I am not convinced this will solve the problem on NonStop where EPERM is reported instead of ENOENT. Apparently EPERM is allowed by POSIX, so text comparison of error messages are not going to work anyway.
Previous: Adam Dinwoodie
Message 10 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.