{"thread":{"id":"54770","subject":"[PATCH] completion: bash: fix gitk alias regression","startedAt":"2020-12-05T07:11:28Z","lastAt":"2020-12-07T21:45:20Z","messageCount":3,"participants":["Felipe Contreras","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"411494","messageId":"20201205071023.1270390-1-felipe.contreras@gmail.com","threadId":"54770","inReplyTo":null,"subject":"[PATCH] completion: bash: fix gitk alias regression","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2020-12-05T07:10:23Z","receivedAt":"2020-12-05T07:11:28Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Long time ago when the _git_complete helper was introduced, _gitk was\nreplaced with __gitk_main, and a placeholder for backwards compatibility\npointing to __git_wrap_main_gitk was left in place.\n\nWhen \"__git_complete gitk __gitk_main\" was called, that created the\n__git_wrap__gitk_main helper, which is just basically \"__git_func_wrap\n__gitk_main\" plus `complete` options.\n\nUnfortunately the commit b0a4b2d257 (completion: add support for\nbackwards compatibility, 2012-05-19) missed a previous instance of a\ncall to _gitk in _git_gitk\n\nSo, basically we had __git_wrap__git_main -> __git_func_wrap __git_main ->\n__git_complete_command gitk -> _git_gitk -> _gitk ->\n__git_wrap__gitk_main -> __git_func_wrap __gitk_main -> __gitk_main.\n\nThere was never any need to call __git_func_wrap twice. Since _git_gitk\nis always called inside the wrapper, it can call __gitk_main directly.\n\nAnd then, in commit 441ecdab37 (completion: bash: remove old compat\nwrappers, 2020-10-27) _gitk was removed, which triggers the following\nerror:\n\n  _git_gitk:9: command not found: _gitk\n\nLet's call the correct function: __gitk_main.\n\nCc: SZEDER Gábor <szeder@ira.uka.de>\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/completion/git-completion.bash | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 1ed03623cd..463a3124da 100644\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -1829,7 +1829,7 @@ _git_fsck ()\n \n _git_gitk ()\n {\n-\t_gitk\n+\t__gitk_main\n }\n \n # Lists matching symbol names from a tag (as in ctags) file.\n-- \n2.29.2\n\n"},{"id":"411495","messageId":"CAMP44s0xdkG5P_QHasQZbM3wNf3H99ZWCKB4qgP0Xdigpo7aoQ@mail.gmail.com","threadId":"54770","inReplyTo":"20201205071023.1270390-1-felipe.contreras@gmail.com","subject":"Re: [PATCH] completion: bash: fix gitk alias regression","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2020-12-05T07:12:42Z","receivedAt":"2020-12-05T07:13:42Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Sat, Dec 5, 2020 at 1:10 AM Felipe Contreras\n<felipe.contreras@gmail.com> wrote:\n>\n> Long time ago when the _git_complete helper was introduced, _gitk was\n> replaced with __gitk_main, and a placeholder for backwards compatibility\n> pointing to __git_wrap_main_gitk was left in place.\n>\n> When \"__git_complete gitk __gitk_main\" was called, that created the\n> __git_wrap__gitk_main helper, which is just basically \"__git_func_wrap\n> __gitk_main\" plus `complete` options.\n>\n> Unfortunately the commit b0a4b2d257 (completion: add support for\n> backwards compatibility, 2012-05-19) missed a previous instance of a\n> call to _gitk in _git_gitk\n>\n> So, basically we had __git_wrap__git_main -> __git_func_wrap __git_main ->\n> __git_complete_command gitk -> _git_gitk -> _gitk ->\n> __git_wrap__gitk_main -> __git_func_wrap __gitk_main -> __gitk_main.\n>\n> There was never any need to call __git_func_wrap twice. Since _git_gitk\n> is always called inside the wrapper, it can call __gitk_main directly.\n>\n> And then, in commit 441ecdab37 (completion: bash: remove old compat\n> wrappers, 2020-10-27) _gitk was removed, which triggers the following\n> error:\n>\n>   _git_gitk:9: command not found: _gitk\n>\n> Let's call the correct function: __gitk_main.\n>\n> Cc: SZEDER Gábor <szeder@ira.uka.de>\n\nHmmm. SZEDER Gábor <szeder.dev@gmail.com>\n\n-- \nFelipe Contreras\n"},{"id":"411649","messageId":"xmqqk0tt8f5o.fsf@gitster.c.googlers.com","threadId":"54770","inReplyTo":"CAMP44s0xdkG5P_QHasQZbM3wNf3H99ZWCKB4qgP0Xdigpo7aoQ@mail.gmail.com","subject":"Re: [PATCH] completion: bash: fix gitk alias regression","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-12-07T21:44:35Z","receivedAt":"2020-12-07T21:45:20Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Felipe Contreras <felipe.contreras@gmail.com> writes:\n\n> On Sat, Dec 5, 2020 at 1:10 AM Felipe Contreras\n> <felipe.contreras@gmail.com> wrote:\n>>\n>> Long time ago when the _git_complete helper was introduced, _gitk was\n>> replaced with __gitk_main, and a placeholder for backwards compatibility\n>> pointing to __git_wrap_main_gitk was left in place.\n>>\n>> When \"__git_complete gitk __gitk_main\" was called, that created the\n>> __git_wrap__gitk_main helper, which is just basically \"__git_func_wrap\n>> __gitk_main\" plus `complete` options.\n>>\n>> Unfortunately the commit b0a4b2d257 (completion: add support for\n>> backwards compatibility, 2012-05-19) missed a previous instance of a\n>> call to _gitk in _git_gitk\n>>\n>> So, basically we had __git_wrap__git_main -> __git_func_wrap __git_main ->\n>> __git_complete_command gitk -> _git_gitk -> _gitk ->\n>> __git_wrap__gitk_main -> __git_func_wrap __gitk_main -> __gitk_main.\n>>\n>> There was never any need to call __git_func_wrap twice. Since _git_gitk\n>> is always called inside the wrapper, it can call __gitk_main directly.\n>>\n>> And then, in commit 441ecdab37 (completion: bash: remove old compat\n>> wrappers, 2020-10-27) _gitk was removed, which triggers the following\n>> error:\n>>\n>>   _git_gitk:9: command not found: _gitk\n>>\n>> Let's call the correct function: __gitk_main.\n>>\n>> Cc: SZEDER Gábor <szeder@ira.uka.de>\n>\n> Hmmm. SZEDER Gábor <szeder.dev@gmail.com>\n\nThanks.\n\nWe've seen two hotfixes including this one on the fc/zsh-completion\ntopic since it has been pushed down to 'master' for a month or so.\nCan somebody give the entire topic a quick eyeballing again (the\nrange is 1d1c4a8759..af806a2c24) just to be sure?\n\n\n\n\n"}]}