Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zsh completion not working #592

Open
humblehacker opened this issue Jul 28, 2023 · 10 comments
Open

zsh completion not working #592

humblehacker opened this issue Jul 28, 2023 · 10 comments

Comments

@humblehacker
Copy link

I've installed git-subrepo by cloning the repo into ~/usr/src/git-subrepo. Then I've added source $HOME/usr/src/git-subrepo/.rc to my .zshrc file.

I can type git subr<tab> and it will complete to git subrepo but subsequent tab presses don't complete correctly. That is, I get a list of files instead of subcommands. If I instead call git-subrepo directly (with the -) and press tab, I get the correct set of subcommands.

Regular git commands complete correctly. For example, git submodule <tab> shows me the correct list of subcommands.

I'm sure it's probably some misconfiguration on my side, but I've tried a bunch of things and so far nothing is helping. Hopefully one of you has seen this before.

@perlpunk
Copy link
Contributor

perlpunk commented Jul 28, 2023

On which platform are you?
I have the same problem on openSUSE Leap 15.5 (git 2.35.3) and Tumbleweed (git 2.41.0). On debian (git 2.39.2) it works fine.
There is probably something different in the git internal completion helpers that makes the difference.

edit: Correction, it works on Leap 15.5.

@humblehacker
Copy link
Author

On which platform are you?

macOS 14

@perlpunk
Copy link
Contributor

And which git version?

@humblehacker
Copy link
Author

git version 2.41.0

@perlpunk
Copy link
Contributor

Ok, that confirms what I thought.
Looking into /usr/share/zsh/functions/Completion/Unix/_git in the different versions I see changes how _git_third_party_commands is handled.
I would have to debug what's going on. Any help from git zsh completion experts welcome =)

@perlpunk
Copy link
Contributor

So in git 2.35.3 /usr/share/zsh/functions/Completion/Unix/_git is loaded once I type git s<tab>.
In the newer git it is not loaded.
@humblehacker do source /usr/share/zsh/functions/Completion/Unix/_git and then try a completion again.

Now to find out why it isn't loaded...

@perlpunk
Copy link
Contributor

perlpunk commented Jul 28, 2023

btw, I also noticed recently that in the newer git advanced completion doesn't work either, so it's not only a problem with third party completions.
for example git b<tab> would normally also list my aliases starting with b, in the newer git it only shows two subcommands, bisect and branch.
Or doing git push fork :b<tab> would normally complete all remote branches starting with b.

I haven't gotten around investigating this.

@humblehacker
Copy link
Author

do source /usr/share/zsh/functions/Completion/Unix/_git and then try a completion again.

Mine was in a different directory (probably because macOS/homebrew), but when I source /usr/share/zsh/5.9/functions/_git completions do start working.

Looks like an unlucky coincidence that something broke in zsh git completions right at the time I installed git-subrepo for the first time.

Thanks for taking a look.

@djr7C4
Copy link

djr7C4 commented Aug 5, 2023

Completions work for me with git 2.41.0, git-subrepo 0.4.6 and zsh 5.9.

@admorgan
Copy link
Collaborator

Can this be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants