Johannes Sixt <j6t@xxxxxxxx> writes: > Am 29.04.20 um 21:50 schrieb Taylor Blau: >> This comment has nothing to do with your series, but I am curious if you >> are planning on touching 'test_might_fail' at all. These can be useful >> for non-Git commands, too, such as 'test_might_fail umask 022' on >> systems that may or may not do something sensible with umask. > > When it's not a git command that might fail, the idiom is > > ... && > { umask 022 || :; } && > ... > > -- Hannes I hoped to find this documented in t/README, but ended up writing this. Overkill? I dunno. -- >8 -- Subject: [PATCH] t/README: document when not to use test_might_fail Signed-off-by: Junio C Hamano <gitster@xxxxxxxxx> --- t/README | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/t/README b/t/README index 13747f1344..870950c7d1 100644 --- a/t/README +++ b/t/README @@ -875,7 +875,9 @@ library for your script to use. - test_might_fail [<options>] <git-command> Similar to test_must_fail, but tolerate success, too. Use this - instead of "<git-command> || :" to catch failures due to segv. + instead of "<git-command> || :" to catch failures due to segv, + but do use "{ <non-git-command> || :; }" to ignore a failure from + a command that is not git. Accepts the same options as test_must_fail.