RE: [PATCH] completion: bash: fix late declaration of __git_cmd_idx

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fabian Wermelinger wrote:
> A recent update to contrib/completion/git-completion.bash causes bash to fail
> auto complete custom commands that are wrapped with __git_func_wrap. Declaring
> __git_cmd_idx=0 inside __git_func_wrap resolves the issue.

I was about to say the idx should be 1, and that fixes the issue, but
actually 0 is more correct, since when we do __git_complete there's
actually no real command.

In the future we might want to improve __git_complete to manufacture a
real command since some completions do check the command at
__git_cmd_idx (e.g. __git_complete_remote_or_refspec), and then set
__git_cmd_idx to 1.

But for now your patch fixes the issue better than my previous patch
[1], however, it's still missing the zsh part. I've sent an update patch
with the best of both [2].

Cheers.

[1] https://lore.kernel.org/git/20210618182518.697912-2-felipe.contreras@xxxxxxxxx/
[2] https://lore.kernel.org/git/20210618185832.700477-1-felipe.contreras@xxxxxxxxx/

Cheers.

-- 
Felipe Contreras



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux