From: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Avoid unportable nested double- and backquotes in shell scripts.
Date: Sat, 8 Jan 2011 17:23:53 +0100 [thread overview]
Message-ID: <20110108162353.GB4786@gmx.de> (raw)
In-Reply-To: <20110108161441.GA28898@burratino>
* Jonathan Nieder wrote on Sat, Jan 08, 2011 at 05:14:41PM CET:
> Ralf Wildenhues wrote:
>
> > [Subject: Avoid unportable nested double- and backquotes in shell scripts]
> >
> > Some shells parse them wrongly, esp. pdksh.
>
> How does it treat $( ) command substitutions? (We use those more
> heavily and they are easier on the eyes anyway.)
Better (except for the usual problems when 'case ...)' comes into play).
But git makes heavy use of "no quoting needed on RHS of assignment"
anyway, so it seems like this would be a good move nonetheless. And the
testsuite uses backticks a lot, it seems a move away from that should be
done more uniformly?
Anyway, I'll be happy to respin in whatever form is acceptable.
> > --- a/t/t9107-git-svn-migrate.sh
> > +++ b/t/t9107-git-svn-migrate.sh
> > @@ -94,7 +94,7 @@ test_expect_success 'migrate --minimize on old inited layout' '
> > echo "$svnrepo"$path > "$GIT_DIR"/svn/$ref/info/url ) || exit 1;
> > done &&
> > git svn migrate --minimize &&
> > - test -z "`git config -l | grep "^svn-remote\.git-svn\."`" &&
> > + ! git config -l | grep "^svn-remote\.git-svn\." &&
>
> I thought I remembered portability problems with the
>
> ! a | b
>
> construct but it seems I am wrong; t7810-grep.sh uses that
> construct without trouble, at least.
Some non-Posix-conforming shells have problems with that too, e.g.,
Solaris /bin/sh, but I figured git wouldn't cater to them as I also saw
other such uses in the tree.
Cheers,
Ralf
next prev parent reply other threads:[~2011-01-08 16:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-08 9:01 [PATCH] Avoid unportable nested double- and backquotes in shell scripts Ralf Wildenhues
2011-01-08 16:14 ` Jonathan Nieder
2011-01-08 16:23 ` Ralf Wildenhues [this message]
2011-01-08 16:48 ` Jonathan Nieder
2011-01-08 18:22 ` Jonathan Nieder
2011-01-10 18:09 ` 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=20110108162353.GB4786@gmx.de \
--to=ralf.wildenhues@gmx.de \
--cc=git@vger.kernel.org \
--cc=jrnieder@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).