git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <rsbecker@nexbridge.com>
To: "'Adam Dinwoodie'" <adam@dinwoodie.org>,
	"'Git Mailing List'" <git@vger.kernel.org>
Cc: "'Ævar Arnfjörð Bjarmason'" <avarab@gmail.com>,
	"'Đoàn Trần Công Danh'" <congdanhqx@gmail.com>,
	"'Emily Shaffer'" <emilyshaffer@google.com>,
	"'Johannes Schindelin'" <johannes.schindelin@gmx.de>,
	"'Johannes Sixt'" <j6t@kdbg.org>,
	"'Junio C Hamano'" <gitster@pobox.com>
Subject: RE: [PATCH v2] t1800: correct test to handle Cygwin
Date: Thu, 15 Sep 2022 04:51:38 -0400	[thread overview]
Message-ID: <002001d8c8e0$617c5f80$24751e80$@nexbridge.com> (raw)
In-Reply-To: <20220915075717.425673-1-adam@dinwoodie.org>

On September 15, 2022 3:57 AM, 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.  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.


      reply	other threads:[~2022-09-15  8:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-01 17:39 [PATCH] t1800: correct test to handle Cygwin Adam Dinwoodie
2022-09-01 18:32 ` Junio C Hamano
2022-09-02  1:55   ` Đoàn Trần Công Danh
2022-09-02 12:22 ` Johannes Schindelin
2022-09-07 20:49   ` Junio C Hamano
2022-09-07 20:57     ` rsbecker
2022-09-13 21:08     ` Adam Dinwoodie
2022-09-13 21:33       ` Junio C Hamano
2022-09-15  7:57 ` [PATCH v2] " Adam Dinwoodie
2022-09-15  8:51   ` rsbecker [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='002001d8c8e0$617c5f80$24751e80$@nexbridge.com' \
    --to=rsbecker@nexbridge.com \
    --cc=adam@dinwoodie.org \
    --cc=avarab@gmail.com \
    --cc=congdanhqx@gmail.com \
    --cc=emilyshaffer@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j6t@kdbg.org \
    --cc=johannes.schindelin@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).