Re: [PATCH 2/1] t3920: support CR-eating grep
- From
René Scharfe <l.s.r@web.de>
- Date
- Dec 5, 2022, 08:28 UTC
- Message-ID
- <569714f6-a913-5f7f-855a-b303adbde3ee@web.de>
- In-Reply-To
- <xmqqo7sisllv.fsf@gitster.g>
Am 05.12.22 um 02:08 schrieb Junio C Hamano:
Show 7 quoted lines
> René Scharfe <l.s.r@web.de> writes:
>
>> grep 'Subject' .crlf-orig-$branch.txt | tr '\n' ' ' | sed 's/[ ]*$//' | tr -d '\n' >.crlf-subject-$branch.txt &&
>> - { grep 'Body' .crlf-message-$branch.txt >.crlf-body-$branch.txt || true; } &&
>> + grep 'Body' .crlf-orig-$branch.txt | append_cr >.crlf-body-$branch.txt &&
>
> Doesn't append_cr unconditionally adds CR at the end?It does.
> Do we need to > touch this test again when "grep" gets fixed on the platform?
Depends on the meaning of "fixed". If it stops removing CRs then this line is unaffected -- .crlf-orig-$branch.txt contains no CRs. If it starts adding CRs then we'd have a problem with all grep invocations, which was addressed by 4d715ac05c (Windows: a test_cmp that is agnostic to random LF <> CRLF conversions, 2013-10-26).
René