git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 00/14] completion: a bunch of updates

From
SZEDER Gábor <szeder.dev@gmail.com>
Date
Jul 3, 2019, 19:06 UTC
Message-ID
<20190703190639.GA20404@szeder.dev>
In-Reply-To
<xmqqk1cz0zz1.fsf@gitster-ct.c.googlers.com>
On Wed, Jul 03, 2019 at 10:50:26AM -0700, Junio C Hamano wrote:
Show 45 quoted lines
> Felipe Contreras <felipe.contreras@gmail.com> writes:
> 
> > Here's another try at completion fixes, cleanups, and more tests. Some
> > of these have already been sent.
> >
> > Felipe Contreras (14):
> >   completion: zsh: fix __gitcomp_direct()
> >   completion: zsh: fix for directories with spaces
> >   completion: remove zsh hack
> >   completion: zsh: improve main function selection
> >   completion: prompt: fix color for Zsh
> >   completion: bash: cleanup cygwin check
> >   completion: zsh: update installation instructions
> >   completion: bash: remove old compat wrappers
> >   completion: bash: remove zsh wrapper
> >   completion: zsh: trivial cleanups
> >   test: completion: tests for __gitcomp regression
> >   test: completion: use global config
> >   completion: add default options
> >   completion: add default merge strategies
> >
> >  contrib/completion/git-completion.bash | 202 +++++++++++++------------
> >  contrib/completion/git-completion.zsh  |  53 +++----
> >  contrib/completion/git-prompt.sh       |  10 +-
> >  t/t9902-completion.sh                  |  37 +++--
> >  4 files changed, 161 insertions(+), 141 deletions(-)
> 
> Having scanned the discussion threads so far, I think the last four
> patches are going against the list consensus of (1) it is OK to rely
> on --git-completion-helper; using ancient Git with new completion
> script won't obviously work, but that is "if it hurts, don't". (2)
> some subcommands will fail the --git-completion-helper request
> (e.g. outside a repository), but as long as the output from failed
> request is not cached, it is OK.
> 
> But we haven't seen any response to the earlier zsh specific
> patches.  Does it mean that nobody other than Felipe cares about
> having a working Git completion for zsh?  Or does it mean that all
> users other than Felipe are happy with the current Git completion
> for zsh and it works very well for them already?  Or somewhere in
> between?
> 
> What I am trying to get at is if we would want to keep the earlier
> zsh parts of the series, but with nobody seemingly interested in, it
> is hard for me to justify queuing them.

I'm not a Zsh user and am mostly unfamiliar with its antics, but FWIW...

Zsh has its own git completion routines, which are in some aspects more advanced than what can be achieved with Bash's completion facilities (or more wasteful in screen real estate, depending on your preferences :), e.g. Zsh's completion shows a short description for each completeable --option and whatnot). I suppose that the avarage Zsh & Git user uses Zsh's own git completion instead of our Bash completion script wrapped for Zsh.

Having said that, I applied the first 7 patches in my tree and then followed the updated installation instructions, and it finally worked. I remember trying it in the past once or twice, to check whether some of my bigger completion updates break something in Zsh, but it never worked. So these patches (and perhaps patch 10 as well) seem to be a definite improvement (though admittedly I haven't tested them thoroughly).

As for the latter part of the series, I think the more hard-coded options we can get rid of the better we are off, and I would rather not see them making a comeback. I don't really have an opinion about patches 8 and 9 (that old wrapper is probably just bitrotting away, but I just tried to source our bash completion script from Zsh, and apart from the deprecation warning it appeared to work).

Previous: Junio C HamanoNext: Felipe Contreras
Message 30 of 58 in “completion: a bunch of updates”
  1. 00/14 completion: a bunch of updatesFelipe Contreras, Jun 21, 2019
  2. 01/14 completion: zsh: fix __gitcomp_direct()Felipe Contreras, Jun 21, 2019
  3. Felipe ContrerasJun 22, 2019
  4. 02/14 completion: zsh: fix for directories with spacesFelipe Contreras, Jun 21, 2019
  5. 03/14 completion: remove zsh hackFelipe Contreras, Jun 21, 2019
  6. 04/14 completion: zsh: improve main function selectionFelipe Contreras, Jun 21, 2019
  7. 05/14 completion: prompt: fix color for ZshFelipe Contreras, Jun 21, 2019
  8. 08/14 completion: bash: remove old compat wrappersFelipe Contreras, Jun 21, 2019
  9. 07/14 completion: zsh: update installation instructionsFelipe Contreras, Jun 21, 2019
  10. 06/14 completion: bash: cleanup cygwin checkFelipe Contreras, Jun 21, 2019
  11. 09/14 completion: bash: remove zsh wrapperFelipe Contreras, Jun 21, 2019
  12. 11/14 test: completion: tests for __gitcomp regressionFelipe Contreras, Jun 21, 2019
  13. Junio C HamanoJul 3, 2019
  14. SZEDER GáborJul 3, 2019
  15. 10/14 completion: zsh: trivial cleanupsFelipe Contreras, Jun 21, 2019
  16. 12/14 test: completion: use global configFelipe Contreras, Jun 21, 2019
  17. Junio C HamanoJul 3, 2019
  18. 13/14 completion: add default optionsFelipe Contreras, Jun 21, 2019
  19. Duy NguyenJun 22, 2019
  20. Felipe ContrerasJun 22, 2019
  21. Junio C HamanoJun 24, 2019
  22. Felipe ContrerasJun 25, 2019
  23. Duy NguyenJun 25, 2019
  24. 14/14 completion: add default merge strategiesFelipe Contreras, Jun 21, 2019
  25. Junio C HamanoJun 24, 2019
  26. Felipe ContrerasJun 25, 2019
  27. Junio C HamanoJun 25, 2019
  28. SZEDER GáborJul 3, 2019
  29. Junio C HamanoJul 3, 2019
  30. SZEDER GáborJul 3, 2019
  31. Felipe ContrerasOct 25, 2020
  32. Felipe ContrerasOct 25, 2020
  33. Junio C HamanoOct 27, 2020
  34. Felipe ContrerasOct 27, 2020
  35. Junio C HamanoOct 27, 2020
  36. Felipe ContrerasOct 28, 2020
  37. Stefan HallerOct 28, 2020
  38. Felipe ContrerasOct 28, 2020
  39. Stefan HallerOct 28, 2020
  40. Junio C HamanoOct 29, 2020
  41. Junio C HamanoOct 29, 2020
  42. Felipe ContrerasNov 2, 2020
  43. Junio C HamanoNov 3, 2020
  44. Felipe ContrerasNov 4, 2020
  45. Junio C HamanoNov 4, 2020
  46. Felipe ContrerasNov 5, 2020
  47. Junio C HamanoNov 5, 2020
  48. Stefan HallerOct 30, 2020
  49. Junio C HamanoOct 30, 2020
  50. Felipe ContrerasNov 2, 2020
  51. Aaron SchrabNov 2, 2020
  52. Junio C HamanoNov 3, 2020
  53. Felipe ContrerasNov 3, 2020
  54. Felipe ContrerasNov 3, 2020
  55. Stefan HallerNov 3, 2020
  56. Junio C HamanoNov 3, 2020
  57. Stefan HallerNov 3, 2020
  58. Felipe ContrerasNov 2, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.