All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: "Øystein Walle" <oystwa@gmail.com>, git@vger.kernel.org
Subject: Re: [PATCH 1/2] t7503: use write_script to generate hook scripts
Date: Wed, 26 Nov 2014 12:07:35 -0800	[thread overview]
Message-ID: <xmqqy4qxpvy0.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <20141126190315.GB1734@peff.net> (Jeff King's message of "Wed, 26 Nov 2014 14:03:15 -0500")

Jeff King <peff@peff.net> 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.

  reply	other threads:[~2014-11-26 20:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-25 22:51 [PATCH 0/2] pre-commit hook updates Øystein Walle
     [not found] ` <cover.1416955873.git.oystwa@gmail.com>
2014-11-25 22:51   ` [PATCH 1/2] t7503: use write_script to generate hook scripts Øystein Walle
2014-11-26  1:25     ` Eric Sunshine
2014-11-26  4:51     ` Jeff King
2014-11-26 18:12       ` Junio C Hamano
2014-11-26 19:03         ` Jeff King
2014-11-26 20:07           ` Junio C Hamano [this message]
2014-11-25 22:51   ` [PATCH 2/2] commit: inform pre-commit that --amend was used Øystein Walle
2014-11-26  1:36     ` Eric Sunshine
2014-11-26  1:32 ` [PATCH 0/2] pre-commit hook updates Eric Sunshine
2014-11-26  4:52 ` Jeff King
2014-11-26 18:35   ` Junio C Hamano
2014-11-26 18:56     ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqy4qxpvy0.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=oystwa@gmail.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.