All of lore.kernel.org
 help / color / mirror / Atom feed
From: "SZEDER Gábor" <szeder.dev@gmail.com>
To: Fionn via GitGitGadget <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org,
	Felipe Contreras <felipe.contreras@gmail.com>,
	Fionn <git@fionn.email>
Subject: Re: [PATCH] completion: exclude previous file arguments in Zsh
Date: Sun, 4 Oct 2026 10:07:23 +0200	[thread overview]
Message-ID: <asIJO3CZ/P/2L4qi@szeder.dev> (raw)
In-Reply-To: <pull.2216.git.git.1791026527023.gitgitgadget@gmail.com>

On Sat, Oct 03, 2026 at 11:22:06AM +0000, Fionn via GitGitGadget wrote:
> We can get this with minor changes, however. Here we introduce an array
> __git_file_exclude which we populate with existing arguments and then

"existing arguments" of what?

> tell compadd to exclude them, which closely matches the Zsh _git
> completion behaviour (as well as common programs such as rm).


> @@ -284,6 +284,8 @@ __git_zsh_main ()
>  
>  		(( $+opt_args[--help] )) && command='help'
>  
> +		__git_file_exclude=(${words[2,-1]:#${words[CURRENT]}})

I don't do Zsh, but that 2 as index looks suspicious.

What will be excluded in the following command line:

  git -C dir -C subdir -c foo.bar=baz add file1 file2 <TAB>

I think we should exclude only those arguments that come after the git
command, in this case after "add", i.e. "file1" and "file2", but I
suspect that everything starting with "dir" will get excluded.

> +
>  		words=( ${orig_words[@]} )
>  
>  		__git_zsh_bash_func $command

  reply	other threads:[~2026-10-04  8:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-03 11:22 [PATCH] completion: exclude previous file arguments in Zsh Fionn via GitGitGadget
2026-10-04  8:07 ` SZEDER Gábor [this message]
2026-10-04 16:17   ` Fionn
2026-10-04 21:13   ` Junio C Hamano
2026-10-05  1:44     ` Fionn

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

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

  git send-email \
    --in-reply-to=asIJO3CZ/P/2L4qi@szeder.dev \
    --to=szeder.dev@gmail.com \
    --cc=felipe.contreras@gmail.com \
    --cc=git@fionn.email \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.