From c5dd0c861ab0db5ad1ecaf9508bdddca83c5cc6e Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Mon, 30 Nov 2020 18:54:31 -0600 Subject: [PATCH 1/2] completion: zsh: fix file completion regression Turns out we always need to set the ignored prefix (compset) to have similar behavior as in default Bash. The issue can be seen with: git show master: Commit 94b2901cfe wrongly removed it. Signed-off-by: Felipe Contreras Signed-off-by: Junio C Hamano --- contrib/completion/git-completion.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/completion/git-completion.zsh b/contrib/completion/git-completion.zsh index e0fda27f4c..6c56296997 100644 --- a/contrib/completion/git-completion.zsh +++ b/contrib/completion/git-completion.zsh @@ -116,6 +116,7 @@ __gitcomp_file () { emulate -L zsh + compset -P '*[=:]' compadd -f -p "${2-}" -- ${(f)1} && _ret=0 } From 076496457e1abe3058d48cb5c387d1face704494 Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Sat, 5 Dec 2020 01:10:23 -0600 Subject: [PATCH 2/2] completion: bash: fix gitk alias regression MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Long time ago when the _git_complete helper was introduced, _gitk was replaced with __gitk_main, and a placeholder for backwards compatibility pointing to __git_wrap_main_gitk was left in place. When "__git_complete gitk __gitk_main" was called, that created the __git_wrap__gitk_main helper, which is just basically "__git_func_wrap __gitk_main" plus `complete` options. Unfortunately the commit b0a4b2d257 (completion: add support for backwards compatibility, 2012-05-19) missed a previous instance of a call to _gitk in _git_gitk So, basically we had __git_wrap__git_main -> __git_func_wrap __git_main -> __git_complete_command gitk -> _git_gitk -> _gitk -> __git_wrap__gitk_main -> __git_func_wrap __gitk_main -> __gitk_main. There was never any need to call __git_func_wrap twice. Since _git_gitk is always called inside the wrapper, it can call __gitk_main directly. And then, in commit 441ecdab37 (completion: bash: remove old compat wrappers, 2020-10-27) _gitk was removed, which triggers the following error: _git_gitk:9: command not found: _gitk Let's call the correct function: __gitk_main. Cc: SZEDER Gábor Signed-off-by: Felipe Contreras Signed-off-by: Junio C Hamano --- contrib/completion/git-completion.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 49a6ef4236..69d8272fa9 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -1806,7 +1806,7 @@ _git_fsck () _git_gitk () { - _gitk + __gitk_main } # Lists matching symbol names from a tag (as in ctags) file.