From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 258DF1F8C1 for ; Fri, 8 May 2020 17:12:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727107AbgEHRMd (ORCPT ); Fri, 8 May 2020 13:12:33 -0400 Received: from cloud.peff.net ([104.130.231.41]:41812 "HELO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1726750AbgEHRMd (ORCPT ); Fri, 8 May 2020 13:12:33 -0400 Received: (qmail 10465 invoked by uid 109); 8 May 2020 17:12:33 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with SMTP; Fri, 08 May 2020 17:12:33 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 30183 invoked by uid 111); 8 May 2020 17:12:33 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Fri, 08 May 2020 13:12:33 -0400 Authentication-Results: peff.net; auth=none Date: Fri, 8 May 2020 13:12:32 -0400 From: Jeff King To: Junio C Hamano Cc: Christopher Warrington via GitGitGadget , git@vger.kernel.org, Christopher Warrington Subject: Re: [PATCH] bisect: fix replay of CRLF logs Message-ID: <20200508171232.GA637136@coredump.intra.peff.net> References: <20200507222510.GA42822@coredump.intra.peff.net> <20200508130831.GB631018@coredump.intra.peff.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Fri, May 08, 2020 at 09:28:56AM -0700, Junio C Hamano wrote: > -- >8 -- > From: Christopher Warrington > Subject: [PATCH] bisect: allow CRLF line endings in "git bisect replay" input > > We advertise that the bisect log can be corrected in your editor > before being fed to "git bisect replay", but some editors may > turn the line endings to CRLF. > > Update the parser of the input lines so that the CR at the end of > the line gets ignored. I'm a little surprised that bash "read" on Windows doesn't eat CRLFs already. But I often find myself confused by line ending decisions in general, as well as the difference between cygwin versus msys versus pure windows binaries, etc. At any rate, munging IFS seems much nicer than having an extra call to tr. > diff --git a/git-bisect.sh b/git-bisect.sh > index efee12b8b1..56548d4be7 100755 > --- a/git-bisect.sh > +++ b/git-bisect.sh > @@ -209,6 +209,7 @@ bisect_replay () { > test "$#" -eq 1 || die "$(gettext "No logfile given")" > test -r "$file" || die "$(eval_gettext "cannot read \$file for replaying")" > git bisect--helper --bisect-reset || exit > + oIFS="$IFS" IFS="$IFS:$(printf '\015')" There's no ":" separator in IFS, so here you're treating colon as end-of-line. I think you just want: IFS="$IFS$(printf '\015')" -Peff