Re: [PATCH 11/12] diff: highlight and error out on incomplete lines
On Mon, Nov 10, 2025 at 1:38 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 10 quoted lines
>
> Phillip Wood <phillip.wood123@gmail.com> writes:
>
> > On 04/11/2025 02:09, Junio C Hamano wrote:
> >> +test_expect_success "incomplete line in both pre- and post-image context" '
> >> + (echo foo && echo baz | tr -d "\012") >x &&
> >
> > 'printf "foo\nbaz"' might be clearer and save us forking "tr"
>
> Perhaps. I find it much harder to read and uglier, though.
Funny, I find it easier to reason about.
It saves not only the tr fork but the subshell, too.
--
D. Ben Knoble