# [PATCH] completion: trivial fix for zsh

3 messages from 2013-05-21 to 2013-05-21. Participants: Felipe Contreras, Junio C Hamano.
Thread: https://gitlist.dev/t/33880

## Felipe Contreras, 2013-05-21 00:33

Subject: [PATCH] completion: trivial fix for zsh
Message-ID: <1369096383-28733-1-git-send-email-felipe.contreras@gmail.com>
URL: https://gitlist.dev/e/1369096383-28733-1-git-send-email-felipe.contreras%40gmail.com

```
zsh completion wrapper doesn't reimplement __gitcompadd(). Although it
should be trivial to do that, let's use __gitcomp_nl() which achieves
exactly the same thing, specially since the suffix ($4) has to be empty.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 contrib/completion/git-completion.bash | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index a98c2fd..1c35eef 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1831,7 +1831,7 @@ _git_config ()
 		local remote="${prev#remote.}"
 		remote="${remote%.fetch}"
 		if [ -z "$cur" ]; then
-			__gitcompadd "refs/heads/" "" "" ""
+			__gitcomp_nl "refs/heads/" "" "" ""
 			return
 		fi
 		__gitcomp_nl "$(__git_refs_remotes "$remote")"
-- 
1.8.3.rc3.286.g3d43083

```

## Felipe Contreras, 2013-05-21 00:38

Subject: Re: [PATCH] completion: trivial fix for zsh
Message-ID: <CAMP44s04oKBtjnF-+5hjPM+-krZA=m-4=Mb=vzU65GsTNhR3vA@mail.gmail.com>
URL: https://gitlist.dev/e/CAMP44s04oKBtjnF-%2B5hjPM%2B-krZA%3Dm-4%3DMb%3DvzU65GsTNhR3vA%40mail.gmail.com
In-Reply-To: <1369096383-28733-1-git-send-email-felipe.contreras@gmail.com>

```
On Mon, May 20, 2013 at 7:33 PM, Felipe Contreras
<felipe.contreras@gmail.com> wrote:
> zsh completion wrapper doesn't reimplement __gitcompadd(). Although it
> should be trivial to do that, let's use __gitcomp_nl() which achieves
> exactly the same thing, specially since the suffix ($4) has to be empty.
>
> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>

This is probably v1.8.3 material, I just noticed it's probably a
regression introduced by 1ce23aa (completion: add new __gitcompadd
helper).

-- 
Felipe Contreras

```

## Junio C Hamano, 2013-05-21 16:28

Subject: Re: [PATCH] completion: trivial fix for zsh
Message-ID: <7vbo84qouo.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vbo84qouo.fsf%40alter.siamese.dyndns.org
In-Reply-To: <CAMP44s04oKBtjnF-+5hjPM+-krZA=m-4=Mb=vzU65GsTNhR3vA@mail.gmail.com>

```
Felipe Contreras <felipe.contreras@gmail.com> writes:

> On Mon, May 20, 2013 at 7:33 PM, Felipe Contreras
> <felipe.contreras@gmail.com> wrote:
>> zsh completion wrapper doesn't reimplement __gitcompadd(). Although it
>> should be trivial to do that, let's use __gitcomp_nl() which achieves
>> exactly the same thing, specially since the suffix ($4) has to be empty.
>>
>> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
>
> This is probably v1.8.3 material, I just noticed it's probably a
> regression introduced by 1ce23aa (completion: add new __gitcompadd
> helper).

Great.  That is not in v1.8.2.X, but was already in v1.8.3-rc0, so
we would need to do something about it.

I am not very happy about the latter "probably", though.  If it is a
regression, at this late in the cycle, it is often safer to revert
the original.

Will apply directly to 'master'.  Thanks.

```
