Re: [PATCH v5 23/28] fsmonitor: never set CE_FSMONITOR_VALID on submodules
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 20, 2022, 23:41 UTC
- Message-ID
- <xmqqv8v3l3w1.fsf@gitster.g>
- In-Reply-To
- <5db241f7d2f654d46d4858ce9e9413032705abf3.1650487399.git.gitgitgadget@gmail.com>
"Jeff Hostetler via GitGitGadget" <gitgitgadget@gmail.com> writes:
> +create_super () {
> + super=$1 &&
> +
> + git init "${super}" &&It is not wrong per-se, but a simple reference to a shell variable without magic interpolation like ${parameter-word} is easier to read without {} around the variable name, i.e.
git init "$super"
an exception of course is when you want to suffix its value with alnum, i.e.
for d in "$super" "${super}1" "$super"2
do
...and writing it as "${super}1" would probably be easier to see what is going on than "$super"2 notation.
> + echo x >${super}/file_1 &&
> + echo y >${super}/file_2 &&
> + echo z >${super}/file_3 &&CodingGuidelines still says that these redirection targets with variable interpolation must be enclosed in double-quotes, i.e.
echo x >"$super/file_1" &&
> + mkdir ${super}/dir_1 &&The double quotes around "${super}" we saw on "git init" indicates that the helper function wants to be prepared to handle a directory path with possibly $IFS whitespace characters in it correctly, so let's make sure we are consistently prepared for such a parameter, i.e.
mkdir "$super/dir_1" &&
The same applies to the rest of the script.
Thanks.