Re: [PATCH v3 3/7] completion: add new __gitcompadd helper
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 12, 2013, 18:51 UTC
- Message-ID
- <7v7gk7eg5p.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <CAMP44s2rE2nniJhC_ZpsdNbp5uZ=tCo+wV6ygth2R5xiVTN=ng@mail.gmail.com>
Felipe Contreras <felipe.contreras@gmail.com> writes:
Show 21 quoted lines
> On Fri, Apr 12, 2013 at 12:55 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> Felipe Contreras <felipe.contreras@gmail.com> writes:
>
>>> }
>>>
>>> # Generates completion reply with compgen from newline-separated possible
>>> @@ -1820,7 +1823,7 @@ _git_config ()
>>> local remote="${prev#remote.}"
>>> remote="${remote%.fetch}"
>>> if [ -z "$cur" ]; then
>>> - COMPREPLY=("refs/heads/")
>>> + __gitcompadd "refs/heads/"
>>
>> I am not sure about this one, though.
>>
>> Other callers took pains to protet against triggering unset variable
>> references by using ${1-} instead of ${1}. Shouldn't this caller be
>> passing three empty strings?
>
> Perhaps, or perhaps we were being too careful before: 'compgen -W foo'
> is the same as 'compgen -W foo -S "" -P "" -- ""'.Yes, they are the same (otherwise this patch would not be valid), but that is not what i was wondering about.