git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
To: "SZEDER Gábor" <szeder@ira.uka.de>
Cc: Stefan Haller <lists@haller-berlin.de>, git@vger.kernel.org
Subject: Re: Zsh completion regression
Date: Sat, 14 Jan 2012 15:32:08 +0100	[thread overview]
Message-ID: <vpq7h0ufj87.fsf@bauges.imag.fr> (raw)
In-Reply-To: <20120114132343.GW30469@goldbirke> ("SZEDER =?iso-8859-1?Q?G?= =?iso-8859-1?Q?=E1bor=22's?= message of "Sat, 14 Jan 2012 14:23:43 +0100")

SZEDER Gábor <szeder@ira.uka.de> writes:

>> but e.g. "git checkout
>> master<TAB>" does not add the trailing space, at all.
>
> I'm not sure what you mean; did you got a trailing space after
> 'master<TAB>' before a31e6262 (completion: optimize refs completion,
> 2011-10-15)?

No. My above sentence should read "... not add the trailing space, at
all, even for bash users". IOW, your understanding is correct.

> We could fix the regression by not appending a space suffix to
> completion words in __gitcomp_nl(), but only when the completion
> script is running under zsh to avoid hurting bash users, like this:
>
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index 2d02a7f3..49393243 100755
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -601,6 +601,9 @@ __gitcomp_nl ()
>  			suffix="$4"
>  		fi
>  	fi
> +	if [ -n "${ZSH_VERSION-}" ] && [ "$suffix" = " " ]; then
> +		suffix=""
> +	fi
>  
>  	IFS=$s
>  	COMPREPLY=($(compgen -P "${2-}" -S "$suffix" -W "$1" -- "$cur_"))

I hate to see special case for different shells, but if no one finds a
better solution, then yes, this is the way to go. Not having the space
may be irritating, but having the quoted space hurts really much more (I
have to delete the space and the backslash manually to continue).

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

  reply	other threads:[~2012-01-14 14:32 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-12 11:52 Zsh completion regression Stefan Haller
2012-01-12 14:56 ` Matthieu Moy
2012-01-14 13:23   ` SZEDER Gábor
2012-01-14 14:32     ` Matthieu Moy [this message]
2012-01-14 15:20       ` SZEDER Gábor
2012-01-14 18:55         ` [PATCH] bash-completion: don't add quoted space for ZSH (fix regression) Matthieu Moy
2012-01-15  2:29           ` Junio C Hamano
2012-01-16 11:49             ` Matthieu Moy
2012-01-16 22:47               ` Junio C Hamano
2012-01-17 12:21                 ` Matthieu Moy
2012-01-17 18:46                   ` Junio C Hamano
2012-01-17 19:18           ` Felipe Contreras
2012-01-17 20:03             ` Felipe Contreras
2012-01-17 20:11               ` Junio C Hamano
2012-01-17 23:04                 ` Felipe Contreras
2012-01-17 23:42                   ` Junio C Hamano
2012-01-18  8:16                     ` Matthieu Moy
2012-01-25  1:39                       ` Felipe Contreras
2012-01-25  4:06                         ` Junio C Hamano
2012-01-14 21:36         ` Zsh completion regression Stefan Haller
2012-01-14 21:36     ` Stefan Haller

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=vpq7h0ufj87.fsf@bauges.imag.fr \
    --to=matthieu.moy@grenoble-inp.fr \
    --cc=git@vger.kernel.org \
    --cc=lists@haller-berlin.de \
    --cc=szeder@ira.uka.de \
    /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.
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).