From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 859d88ce for ; Sun, 2 Feb 2020 07:35:48 +0000 (UTC) Received: (qmail 20550 invoked by alias); 2 Feb 2020 07:35:41 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 45376 Received: (qmail 13991 invoked by uid 1010); 2 Feb 2020 07:35:41 -0000 X-Qmail-Scanner-Diagnostics: from wout5-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.1/25703. spamassassin: 3.4.2. Clear:RC:0(64.147.123.21):SA:0(-2.6/5.0):. Processed in 4.644935 secs); 02 Feb 2020 07:35:41 -0000 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at daniel.shahaf.name does not designate permitted sender hosts) X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrgeeggdduhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfgjfhfogggtgfesthhqtd dtredtjeenucfhrhhomhepffgrnhhivghlucfuhhgrhhgrfhcuoegurdhssegurghnihgv lhdrshhhrghhrghfrdhnrghmvgeqnecuffhomhgrihhnpehophgvnhhsthgrtghkrdhorh hgpdiishhhrdhorhhgnecukfhppeejledrudektddrheejrdduudelnecuvehluhhsthgv rhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepugdrshesuggrnhhivghlrd hshhgrhhgrfhdrnhgrmhgv X-ME-Proxy: Date: Sun, 2 Feb 2020 07:34:53 +0000 From: Daniel Shahaf To: WGH Cc: zsh-workers@zsh.org Subject: Re: [PATCH] _git: Fix __git_recent_branches for case when commit has empty message Message-ID: <20200202073453.75e5514d@tarpaulin.shahaf.local2> In-Reply-To: References: <5391aaa5-73e7-266c-adb2-8c7d96373b8e@torlan.ru> <20200201000919.32cba94b@tarpaulin.shahaf.local2> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable WGH wrote on Sun, 02 Feb 2020 02:50 +0300: > On 2/1/20 3:09 AM, Daniel Shahaf wrote: > > Not on my machine. > > > > First, the unidiff was improperly serialized: the spaces at the start > > of each context line were converted to non-breaking spaces (U+00A0). >=20 > Oh, damn, despite all my efforts, Thunderbird still messed the patch up. = Sigh. (gotta finally find some sane mail client) >=20 Thanks for your efforts. For Thunderbird there's https://wiki.openstack.org/wiki/MailingListEtiquette#Thunderbird , but I don't think it affects you since your email wasn't format=3Dflowed. Usually, I send patches through one of git-send-email(1), Mutt, and Claws. None of them munge whitespace (some of them had to be configured appropriately first). > Anyway, copypasting it from the mailing list archive results in something= that applies cleanly: https://www.zsh.org/mla/workers/2020/msg00190.html If you look at the HTML source of that page you'll find it has the non-breaking spaces still. Firefox, at least, translates NBSP to ordinary space upon copying, so that might explain why copy-pasting that way worked. The problem is that copying text this way would also obliterate any non-breaking spaces that were added intentionally. > > I applied the patch manually, and completion did work, but stderr was > > spammed with two warnings: > > > > +__git_recent_branches:21>=C2=A0=C2=A0 local $'z=3D\C-@' > > __git_recent_branches:21: command not found: >=20 > That isn't supposed to happen. This should merely assign a string contain= ed a single null byte to variable z. Maybe you didn't clean up all those NB= SP? Yes, sounds plausible. If the first column was a non-breaking space, that would cause the observed error message. > > =C2=A0 > > +__git_recent_branches:22> _call_program all-descriptions 'git --no-pag= er for-each-ref --format=3D'\''%(refname)%00%(subject)'\' refs/heads/master= --=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 > > __git_recent_branches:22: unknown file attribute: >=20 > Likewise, I have no clue what it is. That'd be the same issue. The word =C2=ABdescriptions=3D(=E2=80=A6)=C2=BB = was taken as an ordinary positional argument followed by glob qualifiers to the =C2=AB=C2= =A0=C2=BB (NBSP) command. The character =C2=AB=3D=C2=BB is not special when not in a pre-command assignment; it's just an ordinary filename character. I've applied your patch to master with a grammar tweak; it'll be in=C2=A05.8. Thanks again! Daniel