git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Johannes Sixt <j6t@kdbg.org>
Cc: "SZEDER Gábor" <szeder.dev@gmail.com>,
	"Max Kirillov" <max@max630.net>,
	"Carlo Arenas" <carenas@gmail.com>, "Jeff King" <peff@peff.net>,
	git@vger.kernel.org
Subject: Re: [PATCH] test-lib: check Bash version for '-x' without using shell arrays
Date: Wed, 02 Jan 2019 08:46:46 -0800	[thread overview]
Message-ID: <xmqqa7kjknwp.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <a82251fa-38e1-233e-50d3-3ed4850b4e11@kdbg.org> (Johannes Sixt's message of "Wed, 2 Jan 2019 01:20:47 +0100")

Johannes Sixt <j6t@kdbg.org> 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 ${BASH_VERSINFO[0]} -eq 4 &&
> 			 test ${BASH_VERSINFO[1]} -ge 1
> 		       }
>  		     '

It indeed is somewhat easier to see that your version does exactly
the same as the original than the posted patch, but the pattern
substitutions are not all that bad, either.

  reply	other threads:[~2019-01-02 16:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-01 23:19 [PATCH] test-lib: check Bash version for '-x' without using shell arrays SZEDER Gábor
2019-01-02  0:20 ` Johannes Sixt
2019-01-02 16:46   ` Junio C Hamano [this message]
2019-01-03 11:43     ` [PATCH v2] " SZEDER Gábor
2019-01-03 20:29       ` Junio C Hamano
2019-01-04  9:30         ` SZEDER Gábor
2019-01-04 11:25           ` Junio C Hamano
2019-01-04 12:38             ` SZEDER Gábor
2019-01-04 18:42               ` Carlo Arenas
2019-01-04 20:04                 ` Junio C Hamano
2019-01-03  4:52   ` [PATCH] " Jeff King
2019-01-02 18:05 ` Eric Sunshine
2019-01-02 18:31   ` Carlo Arenas
2019-01-03 11:36 ` SZEDER Gábor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqa7kjknwp.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=carenas@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=j6t@kdbg.org \
    --cc=max@max630.net \
    --cc=peff@peff.net \
    --cc=szeder.dev@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).