threads / bug / 65221

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

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

## tl;dr

4 messages between Mar 12, 2026 and Mar 12, 2026.

replies: 3people: 2as markdown or json

Andrey· Mar 12, 2026, 16:14 UTC · lore

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· Mar 12, 2026, 16:21 UTC · re: Andrey · lore

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

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· Mar 12, 2026, 16:26 UTC · re: Junio C Hamano · lore

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

 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:
Show 16 quoted lines
> 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· Mar 12, 2026, 16:47 UTC · re: Junio C Hamano · lore

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

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:
Show 5 quoted lines
> 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

← back to recent threads