{"thread":{"id":"59662","subject":"[PATCH] contrib/completion: fix zsh completion regression","startedAt":"2023-04-27T05:27:29Z","lastAt":"2023-04-27T05:27:29Z","messageCount":1,"participants":["Dimi via GitGitGadget"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"476166","messageId":"pull.1499.git.git.1682573243090.gitgitgadget@gmail.com","threadId":"59662","inReplyTo":null,"subject":"[PATCH] contrib/completion: fix zsh completion regression","fromName":"Dimi via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2023-04-27T05:27:22Z","receivedAt":"2023-04-27T05:27:29Z","isPatch":true,"sender":{"key":"name:Dimi","avatar":null},"body":"From: Dimitar Roustchev <dimitar+github@pagerduty.com>\n\nFrom: Felipe Contreras <felipe.contreras@gmail.com> @ 2021-08-16  9:19 UTC\n[1]\n\nDespite 0b18023 addressing a regression from 59d85a2, the issue\ndescribed in [1] still persists as described:\n\n  compdef _git ga=git-add\n  ga <tab>\n  ga __git_find_on_cmdline:[:16: unknown condition: -lt\n\nThe suggested fix to set __git_cmd_idx for the _git function wrapper\nworked for me on:\n\n- zsh v5.8.1\n- git v2.40.1\n\nSigned-off-by: Dimitar Roustchev <dimitar@pagerduty.com>\n\n[1] https://lore.kernel.org/all/20210816091935.548555-1-felipe.contreras@gmail.com/\n---\n    contrib/completion: fix zsh completion regression\n    \n    Despite 0b18023 addressing a regression from 59d85a2, the issue\n    described in\n    https://lore.kernel.org/all/20210816091935.548555-1-felipe.contreras@gmail.com/T/\n    still persists as described:\n    \n    compdef _git ga=git-add ga ga __git_find_on_cmdline:[:16: unknown\n    condition: -lt\n    \n    The suggested fix to set __git_cmd_idx for the _git function wrapper\n    worked for me on:\n    \n     * zsh v5.8.1\n     * git v2.40.1\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1499%2Fdroustchev-pd%2Ffix-__git_cmd_idx-regression-zsh-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1499/droustchev-pd/fix-__git_cmd_idx-regression-zsh-v1\nPull-Request: https://github.com/git/git/pull/1499\n\n contrib/completion/git-completion.zsh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/contrib/completion/git-completion.zsh b/contrib/completion/git-completion.zsh\nindex cac6f618817..a1f2d278179 100644\n--- a/contrib/completion/git-completion.zsh\n+++ b/contrib/completion/git-completion.zsh\n@@ -271,7 +271,7 @@ __git_zsh_main ()\n _git ()\n {\n \tlocal _ret=1\n-\tlocal cur cword prev\n+\tlocal cur cword prev __git_cmd_idx=0\n \n \tcur=${words[CURRENT]}\n \tprev=${words[CURRENT-1]}\n\nbase-commit: 2807bd2c10606e590886543afe4e4f208dddd489\n-- \ngitgitgadget\n"}]}