Re: [PATCH] test-lib: check Bash version for '-x' without using shell arrays

2019-01-03 Thread SZEDER Gábor
On Wed, Jan 02, 2019 at 12:19:49AM +0100, SZEDER Gábor wrote: > To my understanding both shells are right and conform to POSIX, > because the standard allows both behavior by stating the following > under '2.8.1 Consequences of Shell Errors': > > "An expansion error is one that occurs when the s

Re: [PATCH] test-lib: check Bash version for '-x' without using shell arrays

2019-01-02 Thread Jeff King
On Wed, Jan 02, 2019 at 01:20:47AM +0100, Johannes Sixt wrote: > > diff --git a/t/test-lib.sh b/t/test-lib.sh > > index 0f1faa24b2..f47a191e3b 100644 > > --- a/t/test-lib.sh > > +++ b/t/test-lib.sh > > @@ -324,9 +324,12 @@ do > > # isn't executed with a suitable Bash version. > >

Re: [PATCH] test-lib: check Bash version for '-x' without using shell arrays

2019-01-02 Thread Carlo Arenas
Tested-By: Carlo Marcelo Arenas Belón

Re: [PATCH] test-lib: check Bash version for '-x' without using shell arrays

2019-01-02 Thread Eric Sunshine
On Tue, Jan 1, 2019 at 6:20 PM SZEDER Gábor wrote: > [...] > To my understanding both shells are right and conform to POSIX, > because the standard allows both behavior by stating the following s/behavior/behaviors/ > under '2.8.1 Consequences of Shell Errors': > > Reported-by: Max Kirillov > S

Re: [PATCH] test-lib: check Bash version for '-x' without using shell arrays

2019-01-02 Thread Junio C Hamano
Johannes Sixt writes: > Would it perhaps be simpler to just hide the syntax behind eval? Like > > if test -z "$test_untraceable" || { >test -n "$BASH_VERSION" && eval ' > test ${BASH_VERSINFO[0]} -gt 4 || { >test ${BAS

Re: [PATCH] test-lib: check Bash version for '-x' without using shell arrays

2019-01-01 Thread Johannes Sixt
Am 02.01.19 um 00:19 schrieb SZEDER Gábor: Alas, it has been reported that NetBSD's /bin/sh does complain about them: ./test-lib.sh: 327: Syntax error: Bad substitution where line 327 contains the first ${BASH_VERSINFO[0]} array access. diff --git a/t/test-lib.sh b/t/test-lib.sh index 0f1

[PATCH] test-lib: check Bash version for '-x' without using shell arrays

2019-01-01 Thread SZEDER Gábor
One of our test scripts, 't1510-repo-setup.sh' [1], still can't be reliably run with '-x' tracing enabled, unless it's executed with a Bash version supporting BASH_XTRACEFD (since v4.1). We have a lengthy condition to check the version of the shell running the test script, and disable tracing if i