public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] apply: fix new-style empty context line triggering incomplete-line check
Date: Tue, 17 Mar 2026 11:45:58 -0700	[thread overview]
Message-ID: <xmqqcy12l2ft.fsf@gitster.g> (raw)
In-Reply-To: <CAPig+cTTgLVGPG99gsb19BeJVWS=VZCU4F-rjb25yHTAORWwzg@mail.gmail.com> (Eric Sunshine's message of "Tue, 17 Mar 2026 14:12:12 -0400")

Eric Sunshine <sunshine@sunshineco.com> writes:

>> +       test_when_finished "rm -f sample*-i patch patch-new target" &&
>> +       (test_write_lines 1 2 3 "" 4 5 ) >sample-i &&
>> +       (test_write_lines 1 2 3 "" 0 5 ) >sample2-i &&
>
> Curious. Why are the `test_write_line` invocations wrapped in parentheses?
>
> Also, is the whitespace before the closing parenthesis intentional?
>
>>  test_expect_success 'incomplete context line (not an error)' '
>>         (test_write_lines 1 2 3 4 5 && printf 6) >sample-i &&
>>         (test_write_lines 1 2 3 0 5 && printf 6) >sample2-i &&
>
> Perhaps the parentheses in the new test were copied from some existing
> test, such as this, which already used them for a legitimate reason?

Yes, the existing one was concatenating output from two commands run
in a row into a single redirection, so (grouping of the commands) in
parentheses were justifiable.

The new one does not have such a justification.  Thanks for
noticing.

  reply	other threads:[~2026-03-17 18:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-17 18:01 [PATCH] apply: fix new-style empty context line triggering incomplete-line check Junio C Hamano
2026-03-17 18:12 ` Eric Sunshine
2026-03-17 18:45   ` Junio C Hamano [this message]
2026-03-18 16:36     ` D. Ben Knoble
2026-03-18 16:43       ` Eric Sunshine
2026-03-18 17:12       ` Junio C Hamano

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=xmqqcy12l2ft.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=sunshine@sunshineco.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox