git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Thomas Rast <trast@inf.ethz.ch>
Cc: git@vger.kernel.org, "Torsten Bögershausen" <tboegi@web.de>
Subject: Re: [PATCH 1/2] t9902: fix 'test A == B' to use = operator
Date: Mon, 08 Jul 2013 10:20:48 -0700	[thread overview]
Message-ID: <7v1u790xzj.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <b9e889a27f648c44179ad39159240867f86525f3.1373296313.git.trast@inf.ethz.ch> (Thomas Rast's message of "Mon, 8 Jul 2013 17:20:31 +0200")

Thomas Rast <trast@inf.ethz.ch> writes:

> The == operator as an alias to = is not POSIX.  This doesn't actually
> matter for the execution of the script, because it only runs when the
> shell is bash.  However, it trips up test-lint, so it's nicer to use
> the standard form.

OK, my knee-jerk reaction was "this is only for bash" as you said,
but the test-lint part I agree with.

But then test-lint _ought_ to also catch the use of "local" in the
ideal world, so perhaps in the longer term we would need to treat
this bash-only script differently from others anyway???

>
> Signed-off-by: Thomas Rast <trast@inf.ethz.ch>
> ---
>  t/t9902-completion.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh
> index d9e3103..272a071 100755
> --- a/t/t9902-completion.sh
> +++ b/t/t9902-completion.sh
> @@ -69,7 +69,7 @@ run_completion ()
>  	local -a COMPREPLY _words
>  	local _cword
>  	_words=( $1 )
> -	test "${1: -1}" == ' ' && _words+=('')
> +	test "${1: -1}" = ' ' && _words+=('')
>  	(( _cword = ${#_words[@]} - 1 ))
>  	__git_wrap__git_main && print_comp
>  }

  parent reply	other threads:[~2013-07-08 17:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-08  9:21 [PATCH] t0000: do not use export X=Y Torsten Bögershausen
2013-07-08 14:36 ` Thomas Rast
2013-07-08 15:20   ` [PATCH 1/2] t9902: fix 'test A == B' to use = operator Thomas Rast
2013-07-08 15:20     ` [PATCH 2/2] test-lint: detect 'export FOO=bar' Thomas Rast
2013-07-08 19:31       ` Torsten Bögershausen
2013-07-09  9:28         ` Thomas Rast
2013-07-09  9:53           ` Torsten Bögershausen
2013-07-08 17:20     ` Junio C Hamano [this message]
2013-07-09  9:27       ` [PATCH 1/2] t9902: fix 'test A == B' to use = operator Thomas Rast
2013-07-08 15:20   ` [PATCH] t0000: do not use export X=Y Junio C Hamano

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=7v1u790xzj.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=tboegi@web.de \
    --cc=trast@inf.ethz.ch \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).