{"thread":{"id":"61747","subject":"Remove your ZSH completion in favor of the completion script distributed and maintained by ZSH","startedAt":"2024-07-07T11:54:07Z","lastAt":"2024-07-07T18:17:48Z","messageCount":6,"participants":["Doron Behar","Andreas Schwab","brian m. carlson","rsbecker@nexbridge.com"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"498190","messageId":"mrn75pj663u6ikkwfnoq6c342l7w5plfeju4ji7norsmlzx4jn@3se3fmuqes4p","threadId":"61747","inReplyTo":null,"subject":"Remove your ZSH completion in favor of the completion script distributed and maintained by ZSH","fromName":"Doron Behar","fromEmail":"doron.behar@gmail.com","sentAt":"2024-07-07T11:53:50Z","receivedAt":"2024-07-07T11:54:07Z","isPatch":false,"sender":{"key":"doron.behar@gmail.com","avatar":null},"body":"Hello,\n\nToday I wanted to use some cool features of the ZSH tab completion\nfunction that ZSH provides[1]. Only after half an hour of trying to\ndebug why something didn't work for me, I noticed that I'm not even\nloading ZSH's git tab completion, but I'm loading the implementation\ndistributed by Git, which is undoubtedly inferior in terms of features.\n\nZSH completion is almost always distributed with every distribution of\nZSH, so there is no need for the two projects to maintain two completion\nfunctions for the same program :).\n\n[1]:\nhttps://github.com/zsh-users/zsh/blob/zsh-5.9/Completion/Unix/Command/_git\n\nDoron.\n"},{"id":"498194","messageId":"87cynpnv8m.fsf@igel.home","threadId":"61747","inReplyTo":"mrn75pj663u6ikkwfnoq6c342l7w5plfeju4ji7norsmlzx4jn@3se3fmuqes4p","subject":"Re: Remove your ZSH completion in favor of the completion script distributed and maintained by ZSH","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2024-07-07T14:15:53Z","receivedAt":"2024-07-07T14:21:52Z","isPatch":false,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"On Jul 07 2024, Doron Behar wrote:\n\n> ZSH completion is almost always distributed with every distribution of\n> ZSH, so there is no need for the two projects to maintain two completion\n> functions for the same program :).\n\nHow do they keep it in sync with the particular version of git installed\nin the system?\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1\n\"And now for something completely different.\"\n"},{"id":"498195","messageId":"e4ylt2rihvm2uc22irsxbeid57ijblioekit3o4xpufflrqwal@5t67kr2a5ahq","threadId":"61747","inReplyTo":"87cynpnv8m.fsf@igel.home","subject":"Re: Re: Remove your ZSH completion in favor of the completion script distributed and maintained by ZSH","fromName":"Doron Behar","fromEmail":"doron.behar@gmail.com","sentAt":"2024-07-07T14:47:06Z","receivedAt":"2024-07-07T14:47:32Z","isPatch":false,"sender":{"key":"doron.behar@gmail.com","avatar":null},"body":"They don't perform any version checks as far as I can see in their\nimplementation.\n\nAlmost all commands that the ZSH team maintains completions for, don't\nperform version checks and the maintainers of the commands themselves\ndon't bother taking responsibility for that and usually users don't\ncomplain. If a ZSH user notices a new command or new option missing from\nsuch a completion function, they can submit a patch to the ZSH project,\nand setup a workaround until there is a new ZSH release with their patch\nincluded.\n\nBesides the option of living with this potential version mismatch\nimperfection, you could also ask the ZSH team to remove their\nimplementation and start maintain their implementation here. However,\nthey might object because not all distributions will accommodate to this\nchange in both projects...\n\nI personally think that Git is a stable enough project that the commands\nand options don't deviate enough between the different versions of it,\nSo it'd be easier for you and for the distributions if you'd let go of\nyour implementation.\n\nOn Sun, Jul 07, 2024 at 04:15:53PM +0200, Andreas Schwab wrote:\n> On Jul 07 2024, Doron Behar wrote:\n> \n> > ZSH completion is almost always distributed with every distribution of\n> > ZSH, so there is no need for the two projects to maintain two completion\n> > functions for the same program :).\n> \n> How do they keep it in sync with the particular version of git installed\n> in the system?\n> \n> -- \n> Andreas Schwab, schwab@linux-m68k.org\n> GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1\n> \"And now for something completely different.\"\n> \n"},{"id":"498196","messageId":"ZoqtHrKcdliM4Uf9@tapette.crustytoothpaste.net","threadId":"61747","inReplyTo":"e4ylt2rihvm2uc22irsxbeid57ijblioekit3o4xpufflrqwal@5t67kr2a5ahq","subject":"Re: Re: Remove your ZSH completion in favor of the completion script distributed and maintained by ZSH","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2024-07-07T14:58:38Z","receivedAt":"2024-07-07T14:58:46Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2024-07-07 at 14:47:06, Doron Behar wrote:\n> They don't perform any version checks as far as I can see in their\n> implementation.\n\nThis is true as far as I can tell.  In many cases, the built-in\ncompletion can take advantage of --help output to find the proper\ncommands, and usually it can intuit expected arguments and such.\n\n> Almost all commands that the ZSH team maintains completions for, don't\n> perform version checks and the maintainers of the commands themselves\n> don't bother taking responsibility for that and usually users don't\n> complain. If a ZSH user notices a new command or new option missing from\n> such a completion function, they can submit a patch to the ZSH project,\n> and setup a workaround until there is a new ZSH release with their patch\n> included.\n\nThe only downside of this is that zsh releases very infrequently, so it\nmay take a year to get these changes into distros.  I submitted a change\nto zsh after some Git version changed one of the rebase files, which\nbroke rebase detection, and it took some time to get that out the door.\n\n> Besides the option of living with this potential version mismatch\n> imperfection, you could also ask the ZSH team to remove their\n> implementation and start maintain their implementation here. However,\n> they might object because not all distributions will accommodate to this\n> change in both projects...\n\nNo, please don't do that.  I use the built-in zsh functionality for\ncompletion and things like version control usage and it works very\nnicely.  One of the advantages to using zsh is that it has completion\nbuilt in and doesn't require external dependencies for most of it.\n\nThe only time I've seen problems in the zsh built-in completion was when\nI was dealing with a large repository where getting the list of files in\na repository to complete a filename (e.g., HEAD:<tab>foo) took too long,\nand I've just made it use local files instead, which is acceptable.\n\n> I personally think that Git is a stable enough project that the commands\n> and options don't deviate enough between the different versions of it,\n> So it'd be easier for you and for the distributions if you'd let go of\n> your implementation.\n\nI don't think it's super necessary to get rid of either one.  The Git\nfunctionality is primarily based around bash, which does need this\nfunctionality.  zsh doesn't, but it can be used there if you want things\nto work exactly as it does in bash and want to have the latest version.\n-- \nbrian m. carlson (they/them or he/him)\nToronto, Ontario, CA\n"},{"id":"498198","messageId":"0a3501dad081$69a5c0c0$3cf14240$@nexbridge.com","threadId":"61747","inReplyTo":"e4ylt2rihvm2uc22irsxbeid57ijblioekit3o4xpufflrqwal@5t67kr2a5ahq","subject":"RE: Re: Remove your ZSH completion in favor of the completion script distributed and maintained by ZSH","fromName":"","fromEmail":"rsbecker@nexbridge.com","sentAt":"2024-07-07T15:21:54Z","receivedAt":"2024-07-07T15:22:07Z","isPatch":false,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"On Sunday, July 7, 2024 10:47 AM, Doron Behar wrote:\n>They don't perform any version checks as far as I can see in their implementation.\n>\n>Almost all commands that the ZSH team maintains completions for, don't perform\n>version checks and the maintainers of the commands themselves don't bother\n>taking responsibility for that and usually users don't complain. If a ZSH user notices\n>a new command or new option missing from such a completion function, they can\n>submit a patch to the ZSH project, and setup a workaround until there is a new ZSH\n>release with their patch included.\n>\n>Besides the option of living with this potential version mismatch imperfection, you\n>could also ask the ZSH team to remove their implementation and start maintain\n>their implementation here. However, they might object because not all distributions\n>will accommodate to this change in both projects...\n>\n>I personally think that Git is a stable enough project that the commands and\n>options don't deviate enough between the different versions of it, So it'd be easier\n>for you and for the distributions if you'd let go of your implementation.\n>\n>On Sun, Jul 07, 2024 at 04:15:53PM +0200, Andreas Schwab wrote:\n>> On Jul 07 2024, Doron Behar wrote:\n>>\n>> > ZSH completion is almost always distributed with every distribution\n>> > of ZSH, so there is no need for the two projects to maintain two\n>> > completion functions for the same program :).\n>>\n>> How do they keep it in sync with the particular version of git\n>> installed in the system?\n>>\n>> --\n>> Andreas Schwab, schwab@linux-m68k.org\n>> GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA\n>> AEC1 \"And now for something completely different.\"\n>>\n\nThere 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.\n\n"},{"id":"498201","messageId":"peuc54wlxnhga5vy7rdnx4roudtngoztpodhs3f7ggbjfyzjdh@lgocxezv5tlv","threadId":"61747","inReplyTo":"ZoqtHrKcdliM4Uf9@tapette.crustytoothpaste.net","subject":"Re: Re: Re: Remove your ZSH completion in favor of the completion script distributed and maintained by ZSH","fromName":"Doron Behar","fromEmail":"doron.behar@gmail.com","sentAt":"2024-07-07T18:17:28Z","receivedAt":"2024-07-07T18:17:48Z","isPatch":false,"sender":{"key":"doron.behar@gmail.com","avatar":null},"body":"> > I personally think that Git is a stable enough project that the\n> > commands and options don't deviate enough between the different\n> > versions of it, So it'd be easier for you and for the distributions\n> > if you'd let go of your implementation.\n> \n> I don't think it's super necessary to get rid of either one.  The Git\n> functionality is primarily based around bash, which does need this\n> functionality.  zsh doesn't, but it can be used there if you want things\n> to work exactly as it does in bash and want to have the latest version.\n\nIndeed it would have been ideal if it was possible to use a `zstyle`\nvariable to control which _git implementation to use. However, that's\nnot trivial, as it somewhat depends on which _git implementation is\nfound first in `$fpath`... I'm pretty sure that creating such a\nconsistent interface (no matter which `_git` is found first) will\nrequire submitting a patch also to the ZSH implementation.\n"}]}