Re: [PATCH 06/12] t: prepare execution of potentially failing commands for `set -e`
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Apr 15, 2026, 06:48 UTC
- Message-ID
- <ad80r_oY-uAV2zVt@pks.im>
- In-Reply-To
- <20260414230810.GA3528448@coredump.intra.peff.net>
On Tue, Apr 14, 2026 at 07:08:10PM -0400, Jeff King wrote:
Show 13 quoted lines
> On Tue, Apr 14, 2026 at 06:52:07PM -0400, Jeff King wrote: > > > Short of requiring a third-party shell, the only workaround I can think > > of is to manually "set +e" before using "command", and then restore it > > with "set -e". Gross. > > I guess one other option is to avoid turning on "set -e" at all for > known-buggy shells. We are not relying on it working everywhere, but > rather hoping that if at least one platform uses it, it will find > programming errors in the test script. > > Personally, I am still skeptical that all of this is worth it versus > just checking stderr.
Yeah, the more I dive into this topic the more sceptical I get, as well, as shells behave wildly different around `set -e`. So I'm starting to feel somewhat uncomfortable with the idea of blanket-enabling it for all shells, as that will for sure lead to lots of fallout on platforms that we're not testing.
Maybe we should really only do this for an allow-listed set of shells. Starting with Bash 5 and newer might be good enough, and given that we use Bash for some of our CI jobs we can assume that this would weed out failures anyway.
Patrick