Re: [PATCH 1/2] t7503: use write_script to generate hook scripts

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

 



Jeff King <peff@xxxxxxxx> writes:

> On Wed, Nov 26, 2014 at 10:12:08AM -0800, Junio C Hamano wrote:
>
>> >> +write_script "$HOOK" <<EOF
>> >
>> > While you are touching this line, please make it "<<\EOF". It does not
>> > matter for these simple cases, but as a style, we try to avoid
>> > interpolation unless it is necessary.
>> 
>> Thanks.  It is more about reducing cognitive burden from the
>> readers.  An unquoted <<EOF signals you that your eyes need to scan
>> carefully for $subsitutions to understand what is going on, instead
>> of coasting it over.
>
> While we are talking about it, do we have a style preference on
> always/never using "<<-" unless necessary? I do not think it is as
> important as preventing interpolation, because it does not introduce a
> cognitive load in the same way. But consistently using "<<-" is one less
> thing for shell newbies to be confused by, and to get wrong when
> cargo-culting.

Not using "<<-" is a sign of another problem that is bigger, namely,
the test vector is prepared outside of a test_expect_success setup
block.  Inside test_expect_success, I'd prefer "<<-" to make it
clear where each test begins and next test begins, which would make
it easier for our to coast over.
--
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]