git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Christopher Warrington \(CHRISTOPHER\)" 
	<Christopher.Warrington@microsoft.com>
Cc: "Carlo Marcelo Arenas Belón" <carenas@gmail.com>,
	"git@vger.kernel.org" <git@vger.kernel.org>,
	"liu.denton@gmail.com" <liu.denton@gmail.com>,
	"Garima Singh" <Garima.Singh@microsoft.com>,
	"Jeff King" <peff@peff.net>
Subject: Re: [EXTERNAL] Re: [PATCH 2/3] bisect: remove CR characters from revision in replay
Date: Wed, 20 May 2020 14:14:30 -0700	[thread overview]
Message-ID: <xmqq1rneux55.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <DM5PR00MB0439A347273E56C8697A587A9BB60@DM5PR00MB0439.namprd00.prod.outlook.com> (Christopher Warrington's message of "Wed, 20 May 2020 20:59:30 +0000")

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

> 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.



  reply	other threads:[~2020-05-20 21:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-20  3:44 [PATCH 0/3] openbsd: fixes for 2.27.0-RC0 Carlo Marcelo Arenas Belón
2020-05-20  3:44 ` [PATCH 1/3] t4216: avoid unnecessary subshell in test_bloom_filters_not_used Carlo Marcelo Arenas Belón
2020-05-20 15:04   ` Junio C Hamano
2020-05-20  3:44 ` [PATCH 2/3] bisect: remove CR characters from revision in replay Carlo Marcelo Arenas Belón
2020-05-20 14:56   ` Junio C Hamano
2020-05-20 17:08     ` Carlo Marcelo Arenas Belón
2020-05-20 17:14       ` Junio C Hamano
2020-05-20 20:59       ` [EXTERNAL] " Christopher Warrington (CHRISTOPHER)
2020-05-20 21:14         ` Junio C Hamano [this message]
2020-05-20  3:44 ` [PATCH 3/3] t5520: avoid alternation in grep's BRE (not POSIX) Carlo Marcelo Arenas Belón
2020-05-20 14:58   ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq1rneux55.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=Christopher.Warrington@microsoft.com \
    --cc=Garima.Singh@microsoft.com \
    --cc=carenas@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=liu.denton@gmail.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).