Thread (1 message) 1 message, 1 author, 2020-05-20

Re: [EXTERNAL] Re: [PATCH 2/3] bisect: remove CR characters from revision in replay

From: Junio C Hamano <hidden>
Date: 2020-05-20 21:14:35

"Christopher Warrington (CHRISTOPHER)"
[off-list ref] writes:
On 2020-05-20 at 10:09-07:00, Carlo Marcelo Arenas Belón wrote:
quoted
IMHO it will be probably still cleaner to do `tr -d '\015'`, even if the
patch below avoids all current issues from the testsuite.
My initial attempt to handle CRLF logs was shaped like this:

	tr -d '\r' <"$file" | while read ...

This introduces a subshell, so there were concerns about propagating
variables and exits. So, Peff also suggested preprocessing to a file. Around
the same time Junio tried using IFS, and that was simpler.
One thing was that extra processes and temporary files are pure
overhead when people don't use misbehaving editors, so we could just
say "don't do it then".  It may not be worth paying the cost of
being pessimistic and preparing for the worst.  The "$IFS will split
the tokens on the line for free for us" was a no-cost solution and
that was why I suggested it.

In any case, I think there are folks who are rewriting bisect piece
by piece to C, and at that point it would just be the matter of
using strbuf_getline_lf() vs strbuf_getline() to get rid of the
unwanted CR for free.

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help