From: Junio C Hamano <gitster@pobox.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Jeff King <peff@peff.net>,
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 10:27:32 -0700 [thread overview]
Message-ID: <xmqqa7reyg6z.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <nycvar.QRO.7.76.6.1806281809060.73@tvgsbejvaqbjf.bet> (Johannes Schindelin's message of "Thu, 28 Jun 2018 18:23:56 +0200 (DST)")
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"'
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.
next prev parent reply other threads:[~2018-06-28 17:27 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 [this message]
2018-06-28 17:47 ` Jeff King
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=xmqqa7reyg6z.fsf@gitster-ct.c.googlers.com \
--to=gitster@pobox.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=peff@peff.net \
/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).