Re: [PATCH v3 3/5] commit test: Use write_script

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

 



Eric Sunshine <sunshine@xxxxxxxxxxxxxx> writes:

>> -cat >check-for-diff <<EOF
>> -#!$SHELL_PATH
>> -exec grep '^diff --git' "\$1"
>> +write_script check-for-diff <<-EOF
>> +       exec grep '^diff --git' "\$1"
>
> Food for thought:
>
> The original code used <<EOF since it needed $SHELL_PATH to be
> evaluated at script creation time, and took special care to escape $1
> in the 'grep' invocation since $1 should be evaluated only at script
> execution time.
>
> With the change to write_script(), nothing within the here-doc
> requires evaluation, yet you are still using the evaluating <<-EOF
> form (and manually escaping $1). The intent might be clearer if you
> switch to <<-\EOF which suppresses evaluation (and drop the manual
> escaping of $1).
>
> The same observation applies to the new write_script() invocation to
> create check-for-no-diff in patch 5.

Very good comments.  Thanks.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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]