Re: [PATCH v5 23/28] fsmonitor: never set CE_FSMONITOR_VALID on submodules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Jeff Hostetler via GitGitGadget" <gitgitgadget@xxxxxxxxx> 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.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux