Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: _git-reset doesn't complete newly staged files



On Thu, Mar 10, 2016 at 1:03 PM, Jun T. <takimoto-j@xxxxxxxxxxxxxxxxx> 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



Messages sorted by: Reverse Date, Date, Thread, Author