Re: [PATCH v5 00/12] t: detect errors outside of test cases
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 20, 2026, 16:19 UTC
- Message-ID
- <xmqqfr4pr4e7.fsf@gitster.g>
- In-Reply-To
- <20260420-b4-pks-tests-with-set-e-v5-0-7d3d68292f6b@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 8 quoted lines
> I've created an MR with GitLab [2] and a PR with GitHub [3] to verify > that these changes work on both platforms. > > Changes in v5: > - Allow opting in via `GIT_TEST_USE_SET_E=yes` and enable this option > for Linux CI jobs. > - Another fix for a potentially-failing command. > - Link to v4: https://patch.msgid.link/20260417-b4-pks-tests-with-set-e-v4-0-44d43efdafb1@pks.im
I agree that the explicit GIT_TEST_USE_SET_E option is a good way to go, as it would be clear which ones are (and which ones are not) using it. I am not sure why we have check_fsck() thing? Wasn't it determined that this would fail only with a broken shells, or is it futureproofing just in case the function is used without being tested?
Also you updated in your earlier round to make everybody to use "|| :" not "|| true". Either would work, but this sticks out.
Show 11 quoted lines
> + ## t/t1410-reflog.sh ##
> +@@ t/t1410-reflog.sh: check_have () {
> + }
> +
> + check_fsck () {
> +- git fsck --full >fsck.output
> ++ git fsck --full >fsck.output || true
> + case "$1" in
> + '')
> + test_must_be_empty fsck.output ;;
> +