git/list[1] front-page[2] threads[3] people[4] search[5] about
 

completion: checkout.* not being completed in zsh

From
Pratyush Yadav <me@yadavpratyush.com>
Date
Aug 15, 2019, 19:50 UTC
Message-ID
<20190815185901.btf4d7c4ewsccxuu@localhost.localdomain>
Hi everyone,

I just noticed that checkout.* is not being completed in zsh. I wanted to set checkout.defaultRemote, but zsh would not auto-complete it.

When I do:
$ git config check<Tab>
zsh does not auto-fill "checkout."

Doing the same in bash works, so the functionality is there, it just doesn't work in zsh.

Once I add checkout.defaultRemote to my git config, autocompletion starts working, but only for defaultRemote, even though checkout has two options: defaultRemote and optimizeNewBranch.

To make it clear, this is what happens once I have added checkout.defaultRemote to my config:

$ git config check<Tab> $ git config checkout. # Completes to "checkout.". Correct behaviour. $ git config checkout.<Tab>

# Completes to defaultRemote, even though it should ask between # defaultRemote and optimizeNewBranch $ git config checkout.defaultRemote

I tried looking at contrib/completion, and I can see that zsh completion works on top of bash completion, so I don't know why exactly it works for bash but not for zsh.

I am not too familiar with how these auto completion scripts work, so if someone can point me in the right direction, I'll see if I can figure out a fix and submit it here.

-- 
Regards,
Pratyush Yadav
Next: brian m. carlson
Message 1 of 3 in “completion: checkout.* not being completed in zsh”
  1. Pratyush YadavAug 15, 2019
  2. brian m. carlsonAug 16, 2019
  3. Pratyush YadavAug 17, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.