git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: git@vger.kernel.org
Cc: git-fc@googlegroups.com, Felipe Contreras <felipe.contreras@gmail.com>
Subject: [PATCH 00/51] completion: revamp
Date: Tue, 30 Aug 2022 04:30:47 -0500	[thread overview]
Message-ID: <20220830093138.1581538-1-felipe.contreras@gmail.com> (raw)

This patch series revamps the completion code to git-completion 1.4.

I used to send this series minimizing the delta to git upstream in order
to maximize the chances of it being merged, but it has not received any
feedback since the first time it was sent in 2020 [1], so it is safe to
say upstream has zero interest in getting this merged. It makes no sense
for me to do extra work to maximize the chances of something that will
never happen.

Therefore this series starts with the most intrusive change:
zsh completion tests.

For several years git-completion has been running zsh completion tests
to make sure everything works correctly, not only for bash, but also for
zsh.

The zsh code delta between upstream and git-completion results in 14
tests now passing. The new patch series makes that clear now.

Here's a summary of the differences between upstream and git-completion:

 * Fixed alias regression
 * Make tests work when user has configured GIT_PS1_* variables
 * Enable colors in bash without prompt command
 * Fix suboptions for zsh
 * Fix COMP_WORDBREAKS handling
 * Fix main option handling for zsh
 * Fix -C handling for zsh
 * Fix -c handling for zsh
 * Fix generic completions for zsh
 * Fix configurations with value for zsh (e1e00089da)
 * Fix option relationships for zsh
 * Add improved removable suffix for zsh
 * Plenty of reorganizations and cleanups

For more information check [2].

Cheers.

[1] https://lore.kernel.org/git/20201110212136.870769-1-felipe.contreras@gmail.com/
[2] https://github.com/felipec/git-completion

Felipe Contreras (50):
  test: completion add test for __git_cmd_idx
  test: add zsh completion tests
  completion: fix __git_cmd_idx regression for zsh
  completion: bash: trivial cleanup
  completion: zsh: add higher-priority location
  zsh: simplify realpath dirname idiom
  test: reset environment variables
  completion: prompt: use generic colors
  completion: fix for suboptions with value
  completion: zsh: trivial improvement
  completion: bash: do not modify COMP_WORDBREAKS
  test: completion: fix currently typed words
  test: completion: switch __gitcomp_nl prefix test
  test: completion: add run_func() helper
  completion: bash: remove non-append functionality
  completion: bash: get rid of _append() functions
  completion: bash: get rid of any non-append code
  completion: zsh: fix options with arguments
  completion: zsh: expand --git-dir file argument
  completion: zsh: add support for general -C opts
  completion: zsh: fix for undefined completions
  completion: zsh: add support for general -c opts
  completion: zsh: fix extra space on foo=
  completion: zsh: add excluded options
  completion: zsh: always set compset
  completion: factor out check in __gitcomp
  completion: simplify equal suffix check
  completion: refactor __gitcomp
  completion: simplify __gitcomp
  completion: bash: change suffix check in __gitcomp
  completion: improve __gitcomp suffix code
  test: completion: add missing test
  completion: bash: simplify config_variable_name
  completion: bash: improve __gitcomp description
  completion: add __gitcomp_opts
  completion: bash: cleanup __gitcomp* invocations
  completion: bash: shuffle __gitcomp functions
  completion: zsh: simplify __gitcomp_direct
  completion: zsh: shuffle __gitcomp* functions
  completion: zsh: fix direct quoting
  completion: zsh: add elements individually in __gitcomp_opts
  completion: zsh: add __gitcompadd helper
  completion: zsh: add correct removable suffix
  completion: bash: simplify _get_comp_words_by_ref()
  completion: bash: refactor _get_comp_words_by_ref()
  completion: bash: cleanup _get_comp_words_by_ref()
  completion: bash: trivial cleanup
  completion: bash: rename _get_comp_words_by_ref()
  zsh: remove version
  completion: bash: trivial grammar fix

Michael Bianco (1):
  zsh: resolve symlink of script

 contrib/completion/git-completion.bash |  637 ++++++-------
 contrib/completion/git-completion.zsh  |  146 ++-
 contrib/completion/git-prompt.sh       |   19 +-
 t/t9902-completion.sh                  |  159 ++--
 t/t9903-bash-prompt.sh                 |   16 +-
 t/t9904-zsh-completion.sh              | 1137 ++++++++++++++++++++++++
 t/t9904/.gitignore                     |    1 +
 t/t9904/.zshrc                         |   50 ++
 t/t9904/_git                           |    1 +
 t/t9904/completion                     |   11 +
 10 files changed, 1649 insertions(+), 528 deletions(-)
 create mode 100755 t/t9904-zsh-completion.sh
 create mode 100644 t/t9904/.gitignore
 create mode 100644 t/t9904/.zshrc
 create mode 120000 t/t9904/_git
 create mode 100755 t/t9904/completion

-- 
2.37.2.351.g9bf691b78c.dirty


             reply	other threads:[~2022-08-30  9:31 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-30  9:30 Felipe Contreras [this message]
2022-08-30  9:30 ` [PATCH 01/51] test: completion add test for __git_cmd_idx Felipe Contreras
2022-08-30  9:30 ` [PATCH 02/51] test: add zsh completion tests Felipe Contreras
2022-08-30  9:30 ` [PATCH 03/51] completion: fix __git_cmd_idx regression for zsh Felipe Contreras
2022-08-30  9:30 ` [PATCH 04/51] completion: bash: trivial cleanup Felipe Contreras
2022-08-30  9:30 ` [PATCH 05/51] completion: zsh: add higher-priority location Felipe Contreras
2022-08-30  9:30 ` [PATCH 06/51] zsh: resolve symlink of script Felipe Contreras
2022-08-30  9:30 ` [PATCH 07/51] zsh: simplify realpath dirname idiom Felipe Contreras
2022-08-30  9:30 ` [PATCH 08/51] test: reset environment variables Felipe Contreras
2022-08-30  9:30 ` [PATCH 09/51] completion: prompt: use generic colors Felipe Contreras
2022-08-30  9:30 ` [PATCH 10/51] completion: fix for suboptions with value Felipe Contreras
2022-08-30  9:30 ` [PATCH 11/51] completion: zsh: trivial improvement Felipe Contreras
2022-08-30  9:30 ` [PATCH 12/51] completion: bash: do not modify COMP_WORDBREAKS Felipe Contreras
2022-08-30  9:31 ` [PATCH 13/51] test: completion: fix currently typed words Felipe Contreras
2022-08-30  9:31 ` [PATCH 14/51] test: completion: switch __gitcomp_nl prefix test Felipe Contreras
2022-08-30  9:31 ` [PATCH 15/51] test: completion: add run_func() helper Felipe Contreras
2022-08-30  9:31 ` [PATCH 16/51] completion: bash: remove non-append functionality Felipe Contreras
2022-08-30  9:31 ` [PATCH 17/51] completion: bash: get rid of _append() functions Felipe Contreras
2022-08-30  9:31 ` [PATCH 18/51] completion: bash: get rid of any non-append code Felipe Contreras
2022-08-30  9:31 ` [PATCH 19/51] completion: zsh: fix options with arguments Felipe Contreras
2022-08-30  9:31 ` [PATCH 20/51] completion: zsh: expand --git-dir file argument Felipe Contreras
2022-08-30  9:31 ` [PATCH 21/51] completion: zsh: add support for general -C opts Felipe Contreras
2022-08-30  9:31 ` [PATCH 22/51] completion: zsh: fix for undefined completions Felipe Contreras
2022-08-30  9:31 ` [PATCH 23/51] completion: zsh: add support for general -c opts Felipe Contreras
2022-08-30  9:31 ` [PATCH 24/51] completion: zsh: fix extra space on foo= Felipe Contreras
2022-08-30  9:31 ` [PATCH 25/51] completion: zsh: add excluded options Felipe Contreras
2022-08-30  9:31 ` [PATCH 26/51] completion: zsh: always set compset Felipe Contreras
2022-08-30  9:31 ` [PATCH 27/51] completion: factor out check in __gitcomp Felipe Contreras
2022-08-30  9:31 ` [PATCH 28/51] completion: simplify equal suffix check Felipe Contreras
2022-08-30  9:31 ` [PATCH 29/51] completion: refactor __gitcomp Felipe Contreras
2022-08-30  9:31 ` [PATCH 30/51] completion: simplify __gitcomp Felipe Contreras
2022-08-30  9:31 ` [PATCH 31/51] completion: bash: change suffix check in __gitcomp Felipe Contreras
2022-08-30  9:31 ` [PATCH 32/51] completion: improve __gitcomp suffix code Felipe Contreras
2022-08-30  9:31 ` [PATCH 33/51] test: completion: add missing test Felipe Contreras
2022-08-30  9:31 ` [PATCH 34/51] completion: bash: simplify config_variable_name Felipe Contreras
2022-08-30  9:31 ` [PATCH 35/51] completion: bash: improve __gitcomp description Felipe Contreras
2022-08-30  9:31 ` [PATCH 36/51] completion: add __gitcomp_opts Felipe Contreras
2022-08-30  9:31 ` [PATCH 37/51] completion: bash: cleanup __gitcomp* invocations Felipe Contreras
2022-08-30  9:31 ` [PATCH 38/51] completion: bash: shuffle __gitcomp functions Felipe Contreras
2022-08-30  9:31 ` [PATCH 39/51] completion: zsh: simplify __gitcomp_direct Felipe Contreras
2022-08-30  9:31 ` [PATCH 40/51] completion: zsh: shuffle __gitcomp* functions Felipe Contreras
2022-08-30  9:31 ` [PATCH 41/51] completion: zsh: fix direct quoting Felipe Contreras
2022-08-30  9:31 ` [PATCH 42/51] completion: zsh: add elements individually in __gitcomp_opts Felipe Contreras
2022-08-30  9:31 ` [PATCH 43/51] completion: zsh: add __gitcompadd helper Felipe Contreras
2022-08-30  9:31 ` [PATCH 44/51] completion: zsh: add correct removable suffix Felipe Contreras
2022-08-30  9:31 ` [PATCH 45/51] completion: bash: simplify _get_comp_words_by_ref() Felipe Contreras
2022-08-30  9:31 ` [PATCH 46/51] completion: bash: refactor _get_comp_words_by_ref() Felipe Contreras
2022-08-30  9:31 ` [PATCH 47/51] completion: bash: cleanup _get_comp_words_by_ref() Felipe Contreras
2022-08-30  9:31 ` [PATCH 48/51] completion: bash: trivial cleanup Felipe Contreras
2022-08-30  9:31 ` [PATCH 49/51] completion: bash: rename _get_comp_words_by_ref() Felipe Contreras
2022-08-30  9:31 ` [PATCH 50/51] zsh: remove version Felipe Contreras
2022-08-30  9:31 ` [PATCH 51/51] completion: bash: trivial grammar fix Felipe Contreras

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=20220830093138.1581538-1-felipe.contreras@gmail.com \
    --to=felipe.contreras@gmail.com \
    --cc=git-fc@googlegroups.com \
    --cc=git@vger.kernel.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).