All of lore.kernel.org
 help / color / mirror / Atom feed
From: Harrison McCullough <mccullough.harrison@gmail.com>
To: Felipe Contreras <felipe.contreras@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Error in bash completion
Date: Wed, 16 Jun 2021 20:15:23 -0600	[thread overview]
Message-ID: <CAHLeu+zcgrhvdqMWG1GegSP-y6CmJsJranxX-2MEGkhTaWWHMw@mail.gmail.com> (raw)
In-Reply-To: <60caae2f893ec_894e2085d@natae.notmuch>

I can verify that this fix works. Thank you for the quick response!

-Harrison McCullough

On Wed, Jun 16, 2021 at 8:06 PM Felipe Contreras
<felipe.contreras@gmail.com> wrote:
>
> Harrison McCullough wrote:
> > What did you do before the bug happened? (Steps to reproduce your issue)
> >
> > 1. Create a Bash function, e.g. `ga() { git add "${@:-.}"; }`
> > 2. Use the `__git_complete` function to add Bash tab completion for your custom
> >    Bash function, e.g. `__git_complete ga git_add`
> > 3. Attempt to tab complete a file path, e.g. `ga my-incomplete-file-path<TAB>`
>
> I can reproduce this issue; it's caused by 59d85a2a05
> (git-completion.bash: use $__git_cmd_idx in more places, 2021-04-22)
> which is present in v2.32.
>
> The problem is that __git_find_on_cmdline now relies on __git_cmd_idx,
> which is not defined when you do __git_complete.
>
> The solution is to add __git_cmd_idx=1 to __git_func_wrap.
>
> zsh is also broken by the same change, and the fix is to do the same in
> the _git service.
>
> I've fixed this in git-completion's master branch [1].
>
> You are welcome to trying the fix.
>
> Cheers.
>
> [1] https://github.com/felipec/git-completion/commit/95b3b49
> [2] https://github.com/git/git/commit/59d85a2a05
>
> --
> Felipe Contreras

      reply	other threads:[~2021-06-17  2:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-16 15:44 Harrison McCullough
2021-06-16 17:40 ` Denton Liu
2021-06-16 18:05   ` Harrison McCullough
2021-06-16 19:19   ` Felipe Contreras
2021-06-17  2:06 ` Felipe Contreras
2021-06-17  2:15   ` Harrison McCullough [this message]

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=CAHLeu+zcgrhvdqMWG1GegSP-y6CmJsJranxX-2MEGkhTaWWHMw@mail.gmail.com \
    --to=mccullough.harrison@gmail.com \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --subject='Re: Error in bash completion' \
    /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

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.