zsh-workers
 help / color / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: WGH <wgh@torlan.ru>
Cc: zsh-workers@zsh.org
Subject: Re: [PATCH] _git: Fix __git_recent_branches for case when commit has empty message
Date: Sun, 2 Feb 2020 07:34:53 +0000
Message-ID: <20200202073453.75e5514d@tarpaulin.shahaf.local2> (raw)
In-Reply-To: <e504f0b9-32aa-3125-d31e-cbc0c6c0039c@torlan.ru>

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).
> 
> Oh, damn, despite all my efforts, Thunderbird still messed the patch up. Sigh. (gotta finally find some sane mail client)
> 

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

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>   local $'z=\C-@'
> > __git_recent_branches:21: command not found:
> 
> That isn't supposed to happen. This should merely assign a string contained a single null byte to variable z. Maybe you didn't clean up all those NBSP?

Yes, sounds plausible.  If the first column was a non-breaking space,
that would cause the observed error message.

> >  
> > +__git_recent_branches:22> _call_program all-descriptions 'git --no-pager for-each-ref --format='\''%(refname)%00%(subject)'\' refs/heads/master --                                                                
> > __git_recent_branches:22: unknown file attribute:
> 
> Likewise, I have no clue what it is.

That'd be the same issue.  The word «descriptions=(…)» was taken as an
ordinary positional argument followed by glob qualifiers to the « »
(NBSP) command.  The character «=» 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 5.8.  Thanks again!

Daniel

      reply index

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-31 16:57 WGH
2020-02-01  0:09 ` Daniel Shahaf
2020-02-01 23:50   ` WGH
2020-02-02  7:34     ` Daniel Shahaf [this message]

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

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

  git send-email \
    --in-reply-to=20200202073453.75e5514d@tarpaulin.shahaf.local2 \
    --to=d.s@daniel.shahaf.name \
    --cc=wgh@torlan.ru \
    --cc=zsh-workers@zsh.org \
    /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

zsh-workers

Archives are clonable: git clone --mirror http://inbox.vuxu.org/zsh-workers

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.zsh.workers


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git