From: Pete Wyckoff <pw@padd.com>
To: Johannes Sixt <j6t@kdbg.org>
Cc: git@vger.kernel.org, Vitor Antunes <vitor.hda@gmail.com>
Subject: Re: [PATCH 2/2] git-p4: remove bash-ism in t9800
Date: Sun, 26 Feb 2012 13:16:01 -0500 [thread overview]
Message-ID: <20120226181601.GA10130@padd.com> (raw)
In-Reply-To: <4F4A7057.2020309@kdbg.org>
j6t@kdbg.org wrote on Sun, 26 Feb 2012 18:48 +0100:
> Am 26.02.2012 16:37, schrieb Pete Wyckoff:
> > - P4EDITOR=touch P4USER=bob P4PASSWD=secret test_must_fail "$GITP4" commit --preserve-user &&
> > - test_must_fail git diff --exit-code HEAD..p4/master
> > + # dashism: test_must_fail does not propagate variables
> > + P4EDITOR=touch P4USER=bob P4PASSWD=secret &&
> > + export P4EDITOR P4USER P4PASSWD &&
> > + test_must_fail "$GITP4" commit --preserve-user &&
> > + ! git diff --exit-code HEAD..p4/master
>
> It is a bashism that variables assigned in front of a shell function are
> exported. But it is not a dashism that they are not exported; that
> (surprising?) behavior is actually conforming to POSIX.
>
> With the new code, be aware that the variables remain exported, which
> might affect subsequent tests in general, though not this one, because
> the assignments are in a sub-shell:
>
> > )
> > '
Interesting, thanks. I thought about the subshell behavior and
use, on purpose, the fact that the variables stay exported in the
second and third hunks.
-- Pete
prev parent reply other threads:[~2012-02-26 18:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-26 15:37 [PATCH 0/2] git-p4: remove test bash-isms Pete Wyckoff
2012-02-26 15:37 ` [PATCH 1/2] git-p4: remove bash-ism in t9809 Pete Wyckoff
2012-02-26 15:37 ` [PATCH 2/2] git-p4: remove bash-ism in t9800 Pete Wyckoff
2012-02-26 17:48 ` Johannes Sixt
2012-02-26 18:16 ` Pete Wyckoff [this message]
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=20120226181601.GA10130@padd.com \
--to=pw@padd.com \
--cc=git@vger.kernel.org \
--cc=j6t@kdbg.org \
--cc=vitor.hda@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).