Re: [PATCH] contrib/completion: avoid empty arithemetic expressions

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

 



On Sat, May 29, 2021 at 8:48 PM Felipe Contreras
<felipe.contreras@xxxxxxxxx> wrote:
>
> David Aguilar wrote:
> > diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> > index 3c5739b905..d51ff5302d 100644
> > --- a/contrib/completion/git-completion.bash
> > +++ b/contrib/completion/git-completion.bash
> > @@ -1177,6 +1177,9 @@ __git_aliased_command ()
> >  __git_find_on_cmdline ()
> >  {
> >       local word c="$__git_cmd_idx" show_idx
> > +     if [ -z "$c" ]; then
> > +             c=1
> > +     fi
>
> This is not the correct location to fix this, it's here:
>
> diff --git a/git-completion.zsh b/git-completion.zsh
> index 0ef15ff..df98e68 100644
> --- a/git-completion.zsh
> +++ b/git-completion.zsh
> @@ -233,7 +233,7 @@ __git_zsh_main ()
>                 emulate ksh -c __git_complete_config_variable_name_and_value
>                 ;;
>         (arg)
> -               local command="${words[1]}" __git_dir
> +               local command="${words[1]}" __git_dir __git_cmd_idx=1
>
>                 if (( $+opt_args[--bare] )); then
>                         __git_dir='.'
>
> Commit 59d85a2a05 (git-completion.bash: use $__git_cmd_idx in more
> places, 2021-04-22) broke zsh because it modified __git_main, but not
> __git_zsh_main.
>
> Cheers.
>
> --
> Felipe Contreras

Sweet, thanks Felipe.

The resulting patch is much simpler now too. Please disregard the
previous patches, v2 is on the way.
-- 
David



[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