Re: [POC PATCH 5/5] completion: avoid compgen to fix expansion issues in __gitcomp_nl()

2012-09-28 Thread Jeff King
On Fri, Sep 28, 2012 at 05:08:52PM +0200, SZEDER Gábor wrote: > On Fri, Sep 28, 2012 at 12:09:35PM +0200, SZEDER Gábor wrote: > > __gitcomp_nl () > > { > > local IFS=$'\n' > > - COMPREPLY=($(compgen -P "${2-}" -S "${4- }" -W "$1" -- "${3-$cur}")) > > + COMPREPLY=($(echo "$1" |sed -n "/^$

Re: [POC PATCH 5/5] completion: avoid compgen to fix expansion issues in __gitcomp_nl()

2012-09-28 Thread SZEDER Gábor
On Fri, Sep 28, 2012 at 12:09:35PM +0200, SZEDER Gábor wrote: > __gitcomp_nl () > { > local IFS=$'\n' > - COMPREPLY=($(compgen -P "${2-}" -S "${4- }" -W "$1" -- "${3-$cur}")) > + COMPREPLY=($(echo "$1" |sed -n "/^${3-$cur}/ { $cur can be a path, so it can contain /, which then brea

[POC PATCH 5/5] completion: avoid compgen to fix expansion issues in __gitcomp_nl()

2012-09-28 Thread SZEDER Gábor
compgen performs expansion on all words in the list given to its -W option. This breaks completion in various ways if one of those words can be expanded, as demonstrated by failing tests added in a previous commit. In __gitcomp_nl() we use only a small subset of compgen's functionality: to filter