git/list[1] front-page[2] threads[3] people[4] search[5] about
wed 2026-10-07 17:03 UTC

Re: [PATCH] apply: fix new-style empty context line triggering incomplete-line check

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Mar 18, 2026, 16:43 UTC
Message-ID
<CAPig+cTx3Gho+uYd9+0SjE+x9GA6VMNu78riUZ=h5_QW2vUHNQ@mail.gmail.com>
In-Reply-To
<CALnO6CDNwa8Ez4Ug0f8zNyxF1n3C_j8mLRbH7wChVioNoC5QVw@mail.gmail.com>
On Wed, Mar 18, 2026 at 12:36 PM D. Ben Knoble <ben.knoble@gmail.com> wrote:
Show 20 quoted lines
> On Tue, Mar 17, 2026 at 2:48 PM Junio C Hamano <gitster@pobox.com> wrote:
> > Eric Sunshine <sunshine@sunshineco.com> writes:
> > >>  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.
>
> I think braces { test_writes lines … && printf … ; } would have
> sufficed for the second example, and might be cheaper (avoiding the
> extra process for the subshell, which we've been told is especially
> expensive for Windows).

No doubt. I considered making the exact same comment, however, this is existing code which Junio's patch was not touching, so the comment would not have been directly applicable except possibly as a #leftoverbits for someone to tackle as a mini-project or some such, so I opted against saying anything about it.

Previous: D. Ben KnobleNext: Junio C Hamano
Message 5 of 7 in “apply: fix new-style empty context line triggering incomplete-line check”
  1. apply: fix new-style empty context line triggering incomplete-line checkJunio C Hamano, Mar 17, 2026
  2. Eric SunshineMar 17, 2026
  3. Junio C HamanoMar 17, 2026
  4. D. Ben KnobleMar 18, 2026
  5. Eric SunshineMar 18, 2026
  6. Junio C HamanoMar 18, 2026
  7. Junio C HamanoMar 31, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.