Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [RFC/PATCH] completion: git: add fast mode



On Wed, Nov 25, 2020 at 8:48 AM Eric Cook <llua@xxxxxxx> wrote:
>
> On 11/23/20 12:56 PM, Felipe Contreras wrote:
> > This patch is just to show how merging the gitfast/git zsh
> > wrapper/git-completion might look like.
>
> Would the overall end goal be to merge the feature set of the two
> completers or just allow the two to be used in tandem? The patch
> looks like the latter not the former and if so, is a precedent i
> would like zsh to not set personally.

I think the overall end goal would be to move as much as possible of
the completion to the Git project itself. For example; git commands
have the --git-completion-helper option, which throw something like:

  % git version --git-completion-helper
  --build-options --no-build-options

There is no _git_version() specific function in Git's bash completion,
and yet when you type "git version --<tab>" the options are completed
anyway.

This helps so that new commands get some automatic completion, even
when nothing specific for them is done in the completion script.

It has been discussed in the mailing list to add something similar for
zsh specific completion, so the descriptions are generated too, and
shorthand forms, perhaps with --git-completion-helper=zsh.

This is a lot of work, and it's unclear precisely how Zsh's official
completion could leverage it, but I think it should be doable.

As for the bulk of the code (e.g. __git_complete_revlist), I think the
end goal should be to borrow the way in which Git developers
themselves leverage the power of Git to generate completions, and use
that in the official completion, perhaps with a "fast-mode" zstyle.

There probably shouldn't be any need to source Git's bash completion
script in the end.

But *today*, the people that want a limble fast completion need to use
that script one way or the other.

I see no way around that.

Cheers.

-- 
Felipe Contreras




Messages sorted by: Reverse Date, Date, Thread, Author