Thread (16 messages) flat view 16 messages, 2 authors, 2021-08-17

RE: [ANNOUNCE] Git v2.33.0-rc2 (Build/Test Report)

From: Randall S. Becker <hidden>
Date: 2021-08-17 14:30:46

On August 16, 2021 6:30 PM, Jeff King wrote:
quoted hunk ↗ jump to hunk
To: Randall S. Becker <redacted>
Cc: 'Junio C Hamano' <redacted>; git@vger.kernel.org
Subject: Re: [ANNOUNCE] Git v2.33.0-rc2 (Build/Test Report)

On Mon, Aug 16, 2021 at 06:22:59PM -0400, Jeff King wrote:
quoted
Yeah, I think we are better to get a consistent exit code from perl.
There are a few options here:
So concretely, the patch below works for me (my tests are not failing, but with some instrumenting, I see that the case in question is
exiting with code 25 before this patch, and 255 after. So it really is just that my errno values are lower than yours).

It's ugly, and I kind of wonder if we'd want to do it for every script to get consistent exit codes. But it does work.
diff --git a/git-send-email.perl b/git-send-email.perl index e65d969d0b..c82336c2e8 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -35,8 +35,15 @@ sub readline {
	my $self = shift;
	die "Cannot use readline on FakeTerm: $$self";  }
+
package main;

+$SIG{__DIE__} = sub {
+	CORE::die @_ if $^S; # in an eval; use regular die
+	CORE::die @_ if !defined $^S; # in perl's parser
+	print STDERR "fatal: @_\n";
+	exit 255;
+};

sub usage {
	print <<EOT;
Not as ugly as my suggestion (previous email).
-Randall
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help