git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: David Aguilar <davvid@gmail.com>, Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org,
	"Felipe Contreras" <felipe.contreras@gmail.com>,
	"Denton Liu" <liu.denton@gmail.com>,
	"SZEDER Gábor" <szeder.dev@gmail.com>
Subject: RE: [PATCH] contrib/completion: avoid empty arithemetic expressions
Date: Sat, 29 May 2021 22:48:37 -0500	[thread overview]
Message-ID: <60b30b159bda0_50fd208ee@natae.notmuch> (raw)
In-Reply-To: <20210530021528.21287-1-davvid@gmail.com>

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

  reply	other threads:[~2021-05-30  3:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-30  2:15 [PATCH] contrib/completion: avoid empty arithemetic expressions David Aguilar
2021-05-30  3:48 ` Felipe Contreras [this message]
2021-05-30  6:18   ` David Aguilar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=60b30b159bda0_50fd208ee@natae.notmuch \
    --to=felipe.contreras@gmail.com \
    --cc=davvid@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=liu.denton@gmail.com \
    --cc=szeder.dev@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).