# bash completion bug: "symbolic-ref" subcommand doesn't complete

4 messages from 2026-03-12 to 2026-03-12. Participants: Andrey, Junio C Hamano.
Thread: https://gitlist.dev/t/65221

## Andrey, 2026-03-12 16:14

Subject: bash completion bug: "symbolic-ref" subcommand doesn't complete
Message-ID: <c1e0c05b-c767-4fcc-859a-4da6b90c4497@gmail.com>
URL: https://gitlist.dev/e/c1e0c05b-c767-4fcc-859a-4da6b90c4497%40gmail.com

```
Bash can't complete some commands, e.g. symbolic-ref, bugreport, maybe 
others.

These commands are not seen in the completion output:

|$ git #press Tab
add               blame             citool            diff         gitk  
             log               prune  refs              restore          
  show submodule
am                branch            clean             difftool         
grep              maintenance       pull remote            revert        
     show-branch       switch
apply             bundle            clone             fetch        gui  
              merge             push repack            rm                
sparse-checkout   tag
archive           checkout          commit format-patch      help        
       mergetool  range-diff        replace           scalar            
stage          whatchanged
backfill          cherry            config            fsck         init  
             mv                rebase request-pull      send-email      
   stash             worktree
bisect            cherry-pick       describe          gc         
instaweb          notes             reflog reset             shortlog    
       status |

|
|

There is no such problem with Zsh.

[System Info]
GNU bash, version 5.3.0(1)-release (x86_64-redhat-linux-gnu)
git version 2.53.0
rust: disabled
gettext: enabled
libc info: glibc: 2.42


```

## Junio C Hamano, 2026-03-12 16:21

Subject: Re: bash completion bug: "symbolic-ref" subcommand doesn't complete
Message-ID: <xmqqikb1ggri.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqikb1ggri.fsf%40gitster.g
In-Reply-To: <c1e0c05b-c767-4fcc-859a-4da6b90c4497@gmail.com>

```
Andrey <butirsky@gmail.com> writes:

> Bash can't complete some commands, e.g. symbolic-ref, bugreport, maybe 
> others.

Isn't this working as intended?

Our general principle is that the plumbing commands are not designed
to be "typed" by end-user to use interactively, and cat-file,
commit-tree, etc. are not completed to reduce cluttering when the
user does

	$ git <TAB>

If zsh completion includes plumbing commands, then zsh completion is
buggy, or those who designed zsh completion did not understand the
general principle ;-).

```

## Andrey, 2026-03-12 16:26

Subject: Re: bash completion bug: "symbolic-ref" subcommand doesn't complete
Message-ID: <edc6cbe7-905c-4eb7-9829-5c41f2a8beb0@gmail.com>
URL: https://gitlist.dev/e/edc6cbe7-905c-4eb7-9829-5c41f2a8beb0%40gmail.com
In-Reply-To: <xmqqikb1ggri.fsf@gitster.g>

```
 From what I can see, the file supplying the completion is common for 
bash/zsh, but still, the behavior is different:

|$ head /usr/share/bash-completion/completions/git
# bash/zsh completion support for core Git.
...|

|
|

On 3/12/26 19:21, Junio C Hamano wrote:
> Andrey <butirsky@gmail.com> writes:
>
>> Bash can't complete some commands, e.g. symbolic-ref, bugreport, maybe
>> others.
> Isn't this working as intended?
>
> Our general principle is that the plumbing commands are not designed
> to be "typed" by end-user to use interactively, and cat-file,
> commit-tree, etc. are not completed to reduce cluttering when the
> user does
>
> 	$ git <TAB>
>
> If zsh completion includes plumbing commands, then zsh completion is
> buggy, or those who designed zsh completion did not understand the
> general principle ;-).

```

## Andrey, 2026-03-12 16:47

Subject: Re: bash completion bug: "symbolic-ref" subcommand doesn't complete
Message-ID: <57252c1e-69e6-4953-beb3-3cfd41cab857@gmail.com>
URL: https://gitlist.dev/e/57252c1e-69e6-4953-beb3-3cfd41cab857%40gmail.com
In-Reply-To: <xmqqikb1ggri.fsf@gitster.g>

```
You forgot to mention the main thing:

/usr/share/bash-completion/completions/git:

...
#   GIT_COMPLETION_SHOW_ALL_COMMANDS
#
#     When set to "1" suggest all commands, including plumbing commands
#     which are hidden by default (e.g. "cat-file" on "git ca<TAB>").

Thanks for the tip, though.


On 3/12/26 19:21, Junio C Hamano wrote:
> Isn't this working as intended?
>
> Our general principle is that the plumbing commands are not designed
> to be "typed" by end-user to use interactively, and cat-file,
> commit-tree, etc. are not completed to reduce cluttering

```
