git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
May 20, 2020, 21:14 UTC
Message-ID
<xmqq1rneux55.fsf@gitster.c.googlers.com>
In-Reply-To
<DM5PR00MB0439A347273E56C8697A587A9BB60@DM5PR00MB0439.namprd00.prod.outlook.com>

"Christopher Warrington (CHRISTOPHER)" <Christopher.Warrington@microsoft.com> writes:

Show 12 quoted lines
> On 2020-05-20 at 10:09-07:00, Carlo Marcelo Arenas Belón wrote:
>
>> 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.

Previous: Christopher Warrington (CHRISTOPHER)Next: Carlo Marcelo Arenas Belón
Message 9 of 11 in “openbsd: fixes for 2.27.0-RC0”
  1. 0/3 openbsd: fixes for 2.27.0-RC0Carlo Marcelo Arenas Belón, May 20, 2020
  2. 1/3 t4216: avoid unnecessary subshell in test_bloom_filters_not_usedCarlo Marcelo Arenas Belón, May 20, 2020
  3. Junio C HamanoMay 20, 2020
  4. 2/3 bisect: remove CR characters from revision in replayCarlo Marcelo Arenas Belón, May 20, 2020
  5. Junio C HamanoMay 20, 2020
  6. Carlo Marcelo Arenas BelónMay 20, 2020
  7. Junio C HamanoMay 20, 2020
  8. Christopher Warrington (CHRISTOPHER)May 20, 2020
  9. Junio C HamanoMay 20, 2020
  10. 3/3 t5520: avoid alternation in grep's BRE (not POSIX)Carlo Marcelo Arenas Belón, May 20, 2020
  11. Junio C HamanoMay 20, 2020

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.