From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>,
Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>,
git@vger.kernel.org
Subject: Re: [PATCH 1/1] Makefile: fix the "built from commit" code
Date: Thu, 28 Jun 2018 13:47:21 -0400 [thread overview]
Message-ID: <20180628174721.GD31766@sigill.intra.peff.net> (raw)
In-Reply-To: <xmqqa7reyg6z.fsf@gitster-ct.c.googlers.com>
On Thu, Jun 28, 2018 at 10:27:32AM -0700, Junio C Hamano wrote:
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
> >> I.e.:
> >>
> >> FOO='with spaces'
> >> BAR=$FOO sh -c 'echo $BAR'
> >>
> >> works just fine.
> >
> > $ x="two spaces"
> >
> > $ echo $x
> > two spaces
> >
> > Maybe we should quote a little bit more religiously.
>
> Both of you are wrong ;-)
>
> Of course, the lack of dq around echo's argument makes shell split
> two and spaces into two args and feed them separately to echo, and
> causes echo to show them with a single SP in between. Peff's
> exampel should have been
>
> BAR=$FOO sh -c 'echo "$BAR"'
Yes, that's a better example. I was primarily trying to show that the
outer shell did not barf with "spaces: command not found".
> But that does not have much to do with the primary point Peff was
> talking about, which is that in this sequence:
>
> $ x="two spaces"
> $ y="$x"
> $ z=$x
> $ echo "x=<$x>" "y=<$y>" "z=<$z>"
>
> assignment to y and z behave identically, i.e. dq around "$x" when
> assigning to y is not needed.
I actually had to test it to convince myself that one-shot assignments
behaved the same way, but they do.
-Peff
next prev parent reply other threads:[~2018-06-28 17:47 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-28 12:53 [PATCH 0/1] Makefile: fix the "built from commit" code Johannes Schindelin via GitGitGadget
2018-06-27 19:35 ` [PATCH 1/1] " Johannes Schindelin via GitGitGadget
2018-06-28 13:23 ` Jeff King
2018-06-28 16:23 ` Johannes Schindelin
2018-06-28 17:27 ` Junio C Hamano
2018-06-28 17:47 ` Jeff King [this message]
2018-06-29 11:29 ` Johannes Schindelin
2018-06-28 17:49 ` Jeff King
2018-06-28 13:18 ` [PATCH 0/1] " Johannes Schindelin
2018-06-28 23:14 ` brian m. carlson
2018-06-29 12:16 ` [PATCH v2 0/1] Fix "built from commit" logic Johannes Schindelin via GitGitGadget
2018-06-27 19:35 ` [PATCH v2 1/1] Makefile: fix the "built from commit" code Johannes Schindelin via GitGitGadget
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=20180628174721.GD31766@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=gitster@pobox.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).