Re: [PATCH v6 2/3] am: support --empty option to handle empty patches
From: Junio C Hamano <hidden>
Date: 2021-11-19 16:49:11
Eric Sunshine [off-list ref] writes:
I recently expressed an opposing opinion in [1], stating effectively
that omitting the quotes like this is "an accident waiting to happen":
... the lack of quotes ... in the `echo ... >expect` statement
gives me a moment's pause since it relies upon the fact that
`echo` will insert exactly one space between the ... arguments
(which happens to match the single space in the [command's output]
). For clarity and that extra bit of robustness, I'd probably have
used a single double-quoted string argument with `echo`.
But, it's a fairly minor objection.It indeed is minor enough that a patch to turn an existing echo A B C >expect && test_cmp expect actual into echo "A B C" >expect && test_cmp expect actual is not welcome. But it still is worth pointing out and correcting in a patch to add new code, I would think. It all depends on what we care about, and the use of test_cmp means we do care about exact shape of the string, including the inter-word spacing. Thanks.