From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-2.9 required=3.0 tests=AWL,BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id 6C59920A40 for ; Thu, 30 Nov 2017 01:51:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752838AbdK3BvO (ORCPT ); Wed, 29 Nov 2017 20:51:14 -0500 Received: from mout.gmx.net ([212.227.15.18]:63662 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752734AbdK3BvN (ORCPT ); Wed, 29 Nov 2017 20:51:13 -0500 Received: from virtualbox ([37.201.193.73]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0M2cYX-1f9iGG1f4n-00sRZR; Thu, 30 Nov 2017 02:51:09 +0100 Date: Thu, 30 Nov 2017 02:51:08 +0100 (CET) From: Johannes Schindelin X-X-Sender: virtualbox@virtualbox To: =?UTF-8?Q?SZEDER_G=C3=A1bor?= cc: Robert Abel , git@vger.kernel.org Subject: Re: [PATCH] git-prompt: fix reading files with windows line endings In-Reply-To: <20171130010811.17369-1-szeder.dev@gmail.com> Message-ID: References: <20171130010811.17369-1-szeder.dev@gmail.com> User-Agent: Alpine 2.21.1 (DEB 209 2017-03-23) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-779927207-1512006669=:6482" X-Provags-ID: V03:K0:WWLsTXJxIRMjyxR32QFG3YgUT7+IIdrmjDaJ/4F9DZIwy0th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wP9YZSZgjE= Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-779927207-1512006669=:6482 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Hi G=C3=A1bor, On Thu, 30 Nov 2017, SZEDER G=C3=A1bor wrote: > > > diff --git a/contrib/completion/git-prompt.sh b/contrib/completion/gi= t-prompt.sh > > > index c6cbef38c2..71a64e7959 100644 > > > --- a/contrib/completion/git-prompt.sh > > > +++ b/contrib/completion/git-prompt.sh > > > @@ -282,7 +282,7 @@ __git_eread () > > > { > > > =09local f=3D"$1" > > > =09shift > > > -=09test -r "$f" && read "$@" <"$f" > > > +=09test -r "$f" && read "$@" <"$f" && export $@=3D"${!@%$'\r'}" >=20 > I don't think that export is necessary here. >=20 > > As far as I understand, $'\r' is a Bash-only construct, and this file > > (git-prompt.sh) is targeting other Unix shells, too. >=20 > The only other shell the prompt (and completion) script is targeting > is ZSH, and ZSH understands this construct. We already use this > construct to set IFS in several places in both scripts for a long > time, so it should be fine here, too. That's good to know! I should have `git grep`ped... Sorry for the noise, Johannes --8323329-779927207-1512006669=:6482--