Is zsh completion excluded intentionally?

Asked by Shahar Or

I don't know the policy of including shell completion scripts. I am wondering whether the package does not provide zsh completions intentionally or is it just due to lack of interest from users? I would like my zsh completions to be in sync with the version of git I am using, so consuming them from the distro package seems to make sense. But zsh completions don't seem to be included. Should I convert this to a bug report?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu git Edit question
Assignee:
No assignee Edit question
Solved by:
Manfred Hampl
Solved:
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

For diagnostic purposes please provide the output that you receive for the commands

uname -a
lsb_rlease -crid
apt-cache policy zsh zsh-common git
git --version
zsh --version

You have to be aware that the command completion packages are provided with the shell and not with each application package. E.g. command completion for git is contained in zsh-common (for zsh) and in bash-completion (for bash).

Revision history for this message
Shahar Or (mightyiam) said :
#2

Linux shahar-desktop 5.4.0-47-generic #51-Ubuntu SMP Fri Sep 4 19:50:52 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Distributor ID: Ubuntu
Description: Ubuntu 20.04.1 LTS
Release: 20.04
Codename: focal

zsh:
  Installed: 5.8-3ubuntu1
  Candidate: 5.8-3ubuntu1
  Version table:
 *** 5.8-3ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages
        100 /var/lib/dpkg/status
zsh-common:
  Installed: 5.8-3ubuntu1
  Candidate: 5.8-3ubuntu1
  Version table:
 *** 5.8-3ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages
        500 http://archive.ubuntu.com/ubuntu focal/main i386 Packages
        100 /var/lib/dpkg/status
git:
  Installed: 1:2.25.1-1ubuntu3
  Candidate: 1:2.25.1-1ubuntu3
  Version table:
 *** 1:2.25.1-1ubuntu3 500
        500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages
        100 /var/lib/dpkg/status

git version 2.25.1

zsh 5.8 (x86_64-ubuntu-linux-gnu)

I thought that command completions are included in git, because `dpkg -L | grep bash`:

/etc/bash_completion.d
/etc/bash_completion.d/git-prompt
/usr/share/bash-completion
/usr/share/bash-completion/completions
/usr/share/bash-completion/completions/git
/usr/share/bash-completion/completions/gitk

Revision history for this message
Best Manfred Hampl (m-hampl) said :
#3

See the output of

dpkg-query -S /usr/share/bash-completion/completions/git
dpkg-query -S /usr/share/zsh/functions/Completion/Unix/_git

Revision history for this message
Shahar Or (mightyiam) said :
#4

Thanks Manfred Hampl, that solved my question.