zsh-workers
 help / color / mirror / code / Atom feed
From: Phil Pennock <zsh-workers+phil.pennock@spodhuis.org>
To: zsh-workers@zsh.org
Subject: 5.0.3 +* -> git completion regression
Date: Mon, 16 Dec 2013 03:14:37 -0500	[thread overview]
Message-ID: <20131216081436.GA23085@redoubt.spodhuis.org> (raw)

% git push origin <TAB>
__git_complete_remote_or_refspec:33: bad pattern: +*

Does not occur in a build from 5.0.2, does with 5.0.3; this completion
comes from the git project.

The git project has a _git file which ends up finding a
git-completion.bash file and sourcing that with:

  ZSH_VERSION='' . "$script"

----------------------------8< cut here >8------------------------------
__git_complete_remote_or_refspec ()
{
        local cur_="$cur" cmd="${words[1]}"
[...]
        case "$cur_" in
        *:*)
                case "$COMP_WORDBREAKS" in
                *:*) : great ;;
                *)   pfx="${cur_%%:*}:" ;;
                esac
                cur_="${cur_#*:}"
                lhs=0
                ;;
        +*)
                pfx="+"
                cur_="${cur_#+}"
                ;;
        esac
[...]
----------------------------8< cut here >8------------------------------

That case matching pattern +* is on the 33rd line of the function.

So this appears to be bash not treating the + as special where zsh does.
AFAICT, this seems like perfectly reasonable behaviour on zsh's part,
but nonetheless something which used to work no longer does.

git bisect says this is 68d0d76db55c0b8778f0b68d3eda54060b576c41 :

    31441: use array to decide which forms of pattern are enabled

I think the right approach might be to file a git bug instead, to modify
the _git wrapper from:

  ZSH_VERSION='' . "$script"

to:

  emulate sh -c 'ZSH_VERSION="" . "$script"'

since that fixes it and the zsh behavious appears correct.

Thoughts?  Is there anything which zsh should be doing differently?

-Phil


             reply	other threads:[~2013-12-16  8:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-16  8:14 Phil Pennock [this message]
2013-12-16  9:47 ` Peter Stephenson
2013-12-16 10:37   ` Phil Pennock
2013-12-16 15:56     ` Bart Schaefer
2013-12-16 22:08     ` Peter Stephenson
2013-12-17 17:48       ` Phil Pennock

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=20131216081436.GA23085@redoubt.spodhuis.org \
    --to=zsh-workers+phil.pennock@spodhuis.org \
    --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
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://git.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).