Subject: Re: _git-reset doesn't complete newly staged files
From: Mikael Magnusson <[email-masked]>
To: "Jun T." <[email-masked]>
Cc: "[email-masked]" <[email-masked]>
Date: Thu, 10 Mar 2016 15:35:41 +0100
List-Id: Zsh Workers List <zsh-workers.zsh.org>

On Thu, Mar 10, 2016 at 1:03 PM, Jun T. <[email-masked]> wrote:
>
>> Why does __git_ignore_line escape some characters with backslashes
>> before adding them to $ignored?
>
> I'm rather confused. Isn't it better to UN-quote them?
>
> % touch 'a b.txt'
> % git add <TAB>
> this completes a\ b.txt, and
> % git add a\ b.txt <TAB>
> this still completes a\ b.txt.
>
> Using
>     ignored+=(${(Q)line[1,CURRENT-1]})
>     ignored+=(${(Q)line[CURRENT+1,-1]})
> fixes this. Moreover,
>
> % git add *.txt <TAB>
> this does not complete a\ b.txt anymore.
>
> Or there are something I've overlooked.

Why does _git special case this at all, isn't the generic ignore-line
mechanism for the git-add context good enough?

-- 
Mikael Magnusson