Re: [PATCH v2 06/24] multi-pack-index: load into memory

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

 



Eric Sunshine <sunshine@xxxxxxxxxxxxxx> writes:

> On Thu, Jul 5, 2018 at 10:20 AM Derrick Stolee <stolee@xxxxxxxxx> wrote:
>> On 6/25/2018 3:38 PM, Junio C Hamano wrote:
>> While I don't use substitutions in this patch, I do use them in later
>> patches. Here is the final version of this method:
>>
>> midx_read_expect () {
>>          NUM_PACKS=$1
>>          NUM_OBJECTS=$2
>>          NUM_CHUNKS=$3
>>          EXTRA_CHUNKS="$5"
>>          cat >expect <<-\EOF
>>          header: 4d494458 1 $NUM_CHUNKS $NUM_PACKS
>>          chunks: pack_names oid_fanout oid_lookup
>> object_offsets$EXTRA_CHUNKS
>>          num_objects: $NUM_OBJECTS
>>          packs:
>>          EOF
>>
>> Using <<-\EOF causes these substitutions to fail. Is there a different
>> way I should construct this method?
>
> When you need to interpolate variables into the here-doc, use <<-EOF;
> when you don't, use <<-\EOF.

I think what was said is "in an early step there is no need to
interpolate but the same here-doc will need substitution in a later
step, and that is why I started an early step with a form without
quoting", which is different from "when should I use the form with
and without quoting?"

I think a reasonable response would have been "then please do use
the quoted form in the early step to help reviewers to let them know
there is not yet any substitutions, and then switch to quote-less form
at the step that starts needing substitution.  That way, reviewers can
see the test started to become "interesting" by interpolating variable
bits in the test vector by seeing the line with "<<EOF" appear in
the patch as modified".





[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