* Remove your ZSH completion in favor of the completion script distributed and maintained by ZSH
@ 2024-07-07 11:53 Doron Behar
2024-07-07 14:15 ` Andreas Schwab
0 siblings, 1 reply; 6+ messages in thread
From: Doron Behar @ 2024-07-07 11:53 UTC (permalink / raw)
To: git
Hello,
Today I wanted to use some cool features of the ZSH tab completion
function that ZSH provides[1]. Only after half an hour of trying to
debug why something didn't work for me, I noticed that I'm not even
loading ZSH's git tab completion, but I'm loading the implementation
distributed by Git, which is undoubtedly inferior in terms of features.
ZSH completion is almost always distributed with every distribution of
ZSH, so there is no need for the two projects to maintain two completion
functions for the same program :).
[1]:
https://github.com/zsh-users/zsh/blob/zsh-5.9/Completion/Unix/Command/_git
Doron.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Remove your ZSH completion in favor of the completion script distributed and maintained by ZSH
2024-07-07 11:53 Remove your ZSH completion in favor of the completion script distributed and maintained by ZSH Doron Behar
@ 2024-07-07 14:15 ` Andreas Schwab
2024-07-07 14:47 ` Doron Behar
0 siblings, 1 reply; 6+ messages in thread
From: Andreas Schwab @ 2024-07-07 14:15 UTC (permalink / raw)
To: git
On Jul 07 2024, Doron Behar wrote:
> ZSH completion is almost always distributed with every distribution of
> ZSH, so there is no need for the two projects to maintain two completion
> functions for the same program :).
How do they keep it in sync with the particular version of git installed
in the system?
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Re: Remove your ZSH completion in favor of the completion script distributed and maintained by ZSH
2024-07-07 14:15 ` Andreas Schwab
@ 2024-07-07 14:47 ` Doron Behar
2024-07-07 14:58 ` brian m. carlson
2024-07-07 15:21 ` rsbecker
0 siblings, 2 replies; 6+ messages in thread
From: Doron Behar @ 2024-07-07 14:47 UTC (permalink / raw)
To: git
They don't perform any version checks as far as I can see in their
implementation.
Almost all commands that the ZSH team maintains completions for, don't
perform version checks and the maintainers of the commands themselves
don't bother taking responsibility for that and usually users don't
complain. If a ZSH user notices a new command or new option missing from
such a completion function, they can submit a patch to the ZSH project,
and setup a workaround until there is a new ZSH release with their patch
included.
Besides the option of living with this potential version mismatch
imperfection, you could also ask the ZSH team to remove their
implementation and start maintain their implementation here. However,
they might object because not all distributions will accommodate to this
change in both projects...
I personally think that Git is a stable enough project that the commands
and options don't deviate enough between the different versions of it,
So it'd be easier for you and for the distributions if you'd let go of
your implementation.
On Sun, Jul 07, 2024 at 04:15:53PM +0200, Andreas Schwab wrote:
> On Jul 07 2024, Doron Behar wrote:
>
> > ZSH completion is almost always distributed with every distribution of
> > ZSH, so there is no need for the two projects to maintain two completion
> > functions for the same program :).
>
> How do they keep it in sync with the particular version of git installed
> in the system?
>
> --
> Andreas Schwab, schwab@linux-m68k.org
> GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
> "And now for something completely different."
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Re: Remove your ZSH completion in favor of the completion script distributed and maintained by ZSH
2024-07-07 14:47 ` Doron Behar
@ 2024-07-07 14:58 ` brian m. carlson
2024-07-07 18:17 ` Doron Behar
2024-07-07 15:21 ` rsbecker
1 sibling, 1 reply; 6+ messages in thread
From: brian m. carlson @ 2024-07-07 14:58 UTC (permalink / raw)
To: git
[-- Attachment #1: Type: text/plain, Size: 2579 bytes --]
On 2024-07-07 at 14:47:06, Doron Behar wrote:
> They don't perform any version checks as far as I can see in their
> implementation.
This is true as far as I can tell. In many cases, the built-in
completion can take advantage of --help output to find the proper
commands, and usually it can intuit expected arguments and such.
> Almost all commands that the ZSH team maintains completions for, don't
> perform version checks and the maintainers of the commands themselves
> don't bother taking responsibility for that and usually users don't
> complain. If a ZSH user notices a new command or new option missing from
> such a completion function, they can submit a patch to the ZSH project,
> and setup a workaround until there is a new ZSH release with their patch
> included.
The only downside of this is that zsh releases very infrequently, so it
may take a year to get these changes into distros. I submitted a change
to zsh after some Git version changed one of the rebase files, which
broke rebase detection, and it took some time to get that out the door.
> Besides the option of living with this potential version mismatch
> imperfection, you could also ask the ZSH team to remove their
> implementation and start maintain their implementation here. However,
> they might object because not all distributions will accommodate to this
> change in both projects...
No, please don't do that. I use the built-in zsh functionality for
completion and things like version control usage and it works very
nicely. One of the advantages to using zsh is that it has completion
built in and doesn't require external dependencies for most of it.
The only time I've seen problems in the zsh built-in completion was when
I was dealing with a large repository where getting the list of files in
a repository to complete a filename (e.g., HEAD:<tab>foo) took too long,
and I've just made it use local files instead, which is acceptable.
> I personally think that Git is a stable enough project that the commands
> and options don't deviate enough between the different versions of it,
> So it'd be easier for you and for the distributions if you'd let go of
> your implementation.
I don't think it's super necessary to get rid of either one. The Git
functionality is primarily based around bash, which does need this
functionality. zsh doesn't, but it can be used there if you want things
to work exactly as it does in bash and want to have the latest version.
--
brian m. carlson (they/them or he/him)
Toronto, Ontario, CA
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: Re: Remove your ZSH completion in favor of the completion script distributed and maintained by ZSH
2024-07-07 14:47 ` Doron Behar
2024-07-07 14:58 ` brian m. carlson
@ 2024-07-07 15:21 ` rsbecker
1 sibling, 0 replies; 6+ messages in thread
From: rsbecker @ 2024-07-07 15:21 UTC (permalink / raw)
To: 'Doron Behar', git
On Sunday, July 7, 2024 10:47 AM, Doron Behar wrote:
>They don't perform any version checks as far as I can see in their implementation.
>
>Almost all commands that the ZSH team maintains completions for, don't perform
>version checks and the maintainers of the commands themselves don't bother
>taking responsibility for that and usually users don't complain. If a ZSH user notices
>a new command or new option missing from such a completion function, they can
>submit a patch to the ZSH project, and setup a workaround until there is a new ZSH
>release with their patch included.
>
>Besides the option of living with this potential version mismatch imperfection, you
>could also ask the ZSH team to remove their implementation and start maintain
>their implementation here. However, they might object because not all distributions
>will accommodate to this change in both projects...
>
>I personally think that Git is a stable enough project that the commands and
>options don't deviate enough between the different versions of it, So it'd be easier
>for you and for the distributions if you'd let go of your implementation.
>
>On Sun, Jul 07, 2024 at 04:15:53PM +0200, Andreas Schwab wrote:
>> On Jul 07 2024, Doron Behar wrote:
>>
>> > ZSH completion is almost always distributed with every distribution
>> > of ZSH, so there is no need for the two projects to maintain two
>> > completion functions for the same program :).
>>
>> How do they keep it in sync with the particular version of git
>> installed in the system?
>>
>> --
>> Andreas Schwab, schwab@linux-m68k.org
>> GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA
>> AEC1 "And now for something completely different."
>>
There are frequent updates to the git CLI. Freezing ZSH completion at an older version may not be useful. If there is a version compatibility error during install, perhaps take this up with rpm or apt depending on your package manager. I am curious as to why ZSH is overriding git completions.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Re: Re: Remove your ZSH completion in favor of the completion script distributed and maintained by ZSH
2024-07-07 14:58 ` brian m. carlson
@ 2024-07-07 18:17 ` Doron Behar
0 siblings, 0 replies; 6+ messages in thread
From: Doron Behar @ 2024-07-07 18:17 UTC (permalink / raw)
To: git; +Cc: brian m. carlson
> > I personally think that Git is a stable enough project that the
> > commands and options don't deviate enough between the different
> > versions of it, So it'd be easier for you and for the distributions
> > if you'd let go of your implementation.
>
> I don't think it's super necessary to get rid of either one. The Git
> functionality is primarily based around bash, which does need this
> functionality. zsh doesn't, but it can be used there if you want things
> to work exactly as it does in bash and want to have the latest version.
Indeed it would have been ideal if it was possible to use a `zstyle`
variable to control which _git implementation to use. However, that's
not trivial, as it somewhat depends on which _git implementation is
found first in `$fpath`... I'm pretty sure that creating such a
consistent interface (no matter which `_git` is found first) will
require submitting a patch also to the ZSH implementation.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-07-07 18:17 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-07 11:53 Remove your ZSH completion in favor of the completion script distributed and maintained by ZSH Doron Behar
2024-07-07 14:15 ` Andreas Schwab
2024-07-07 14:47 ` Doron Behar
2024-07-07 14:58 ` brian m. carlson
2024-07-07 18:17 ` Doron Behar
2024-07-07 15:21 ` rsbecker
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 NNTP newsgroup(s).