git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Kastrup <dak@gnu.org>
To: Johannes Sixt <j.sixt@viscovery.net>
Cc: "Torsten Bögershausen" <tboegi@web.de>,
	"Elia Pinto" <gitter.spiros@gmail.com>,
	git@vger.kernel.org
Subject: Re: [PATCH] Get rid of the non portable shell export VAR=VALUE costruct
Date: Thu, 22 May 2014 16:37:37 +0200	[thread overview]
Message-ID: <871tvl98we.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <537E09AA.7030901@viscovery.net> (Johannes Sixt's message of "Thu, 22 May 2014 16:28:58 +0200")

Johannes Sixt <j.sixt@viscovery.net> writes:

> Am 5/22/2014 15:19, schrieb David Kastrup:
>> Torsten Bögershausen <tboegi@web.de> writes:
>> 
>>> On 2014-05-22 14.48, Elia Pinto wrote:
>>>> Found by check-non-portable-shell.pl
>>>
>>> Thanks for picking this up
>>>> -export TEST_DIRECTORY=$(pwd)/../../../t
>>>> +TEST_DIRECTORY=$(pwd)/../../../t && export TEST_DIRECTORY
>>> Minor remark:
>>> Both commands should go on their own line, like this:
>>>
>>> TEST_DIRECTORY=$(pwd)/../../../t &&
>>> export TEST_DIRECTORY
>>>
>>>
>>> And, unrelated to this patch, 
>>> there seem to be a lot of && missing in git-remote-testgit.sh.
>> 
>> I have a hard time taking the above && seriously.  pwd is a shell
>> builtin (when we are not talking about Version 3 UNIX or something) that
>> can hardly fail.  And when your shell does not support assignment to a
>> shell variable, you'll have a hard time getting the shell script to run.
>
> The && after an assignment makes a big difference when the assignment is
> part of an && chain. This is *very* common in our test suite, as you know.
>
> People tend to copy-and-paste. And then it is better to provide a more
> universally applicable precedent.

Copy-and-paste will not magically add the second && that would be
required for that usage, and the one in the line above might mislead you
into thinking that the problem "has been dealt with already".

So I'm not convinced that using && outside of a preexisting && chain
makes any sense in this context.

-- 
David Kastrup

  reply	other threads:[~2014-05-22 14:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-22 12:48 [PATCH] Get rid of the non portable shell export VAR=VALUE costruct Elia Pinto
2014-05-22 13:13 ` Torsten Bögershausen
2014-05-22 13:19   ` David Kastrup
2014-05-22 14:28     ` Johannes Sixt
2014-05-22 14:37       ` David Kastrup [this message]
2014-05-22 13:57   ` Elia Pinto
2014-05-22 23:42     ` 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

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

  git send-email \
    --in-reply-to=871tvl98we.fsf@fencepost.gnu.org \
    --to=dak@gnu.org \
    --cc=git@vger.kernel.org \
    --cc=gitter.spiros@gmail.com \
    --cc=j.sixt@viscovery.net \
    --cc=tboegi@web.de \
    /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).