All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 00/29] completion: zsh: latest patches
@ 2020-10-28  2:06 Felipe Contreras
  2020-10-28  2:06 ` [PATCH v3 01/29] completion: zsh: fix __gitcomp_direct() Felipe Contreras
                   ` (29 more replies)
  0 siblings, 30 replies; 31+ messages in thread
From: Felipe Contreras @ 2020-10-28  2:06 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, SZEDER Gábor, Felipe Contreras

Hi,

I've been carrying around these patches for quite some time, many have already
been sent, others I refactored to make them more clear.

These patches correspond to version 1.1 of git-completion:

https://github.com/felipec/git-completion

Changes since v2:

 * Silenced pkg-config command in case of errors
 * Improved loading of bash script so it's backwards compatible

Cheers.

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 26538efb80..49a6ef4236 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -3474,7 +3474,6 @@ __git_func_wrap ()
 # This is NOT a public function; use at your own risk.
 __git_complete ()
 {
-	test -n "$ZSH_VERSION" && return
 	local wrapper="__git_wrap${2}"
 	eval "$wrapper () { __git_func_wrap $2 ; }"
 	complete -o bashdefault -o default -o nospace -F $wrapper $1 2>/dev/null \
diff --git a/contrib/completion/git-completion.zsh b/contrib/completion/git-completion.zsh
index d25f8691ef..e0fda27f4c 100644
--- a/contrib/completion/git-completion.zsh
+++ b/contrib/completion/git-completion.zsh
@@ -27,19 +27,26 @@ zstyle -T ':completion:*:*:git:*' tag-order && \
 zstyle -s ":completion:*:*:git:*" script script
 if [ -z "$script" ]; then
 	local -a locations
-	local e
+	local e bash_completion
+
+	bash_completion=$(pkg-config --variable=completionsdir bash-completion 2>/dev/null) ||
+		bash_completion='/usr/share/bash-completion/completions/'
+
 	locations=(
 		"$(dirname ${funcsourcetrace[1]%:*})"/git-completion.bash
 		"$HOME/.local/share/bash-completion/completions/git"
-		"$(pkg-config --variable=completionsdir bash-completion)"/git
-		'/usr/share/bash-completion/completions/git'
+		"$bash_completion/git"
 		'/etc/bash_completion.d/git' # old debian
 		)
 	for e in $locations; do
 		test -f $e && script="$e" && break
 	done
 fi
+
+local old_complete="$functions[complete]"
+functions[complete]=:
 GIT_SOURCING_ZSH_COMPLETION=y . "$script"
+functions[complete]="$old_complete"
 
 __gitcomp ()
 {
@@ -129,7 +136,7 @@ __gitcomp_file_direct ()
 
 _git_zsh ()
 {
-	__gitcomp "v1.0"
+	__gitcomp "v1.1"
 }
 
 __git_complete_command ()


Felipe Contreras (29):
  completion: zsh: fix __gitcomp_direct()
  completion: zsh: fix name due to broken autoloading
  completion: zsh: fix bash script extension
  completion: zsh: reorganize install instructions
  completion: zsh: fix for directories with spaces
  completion: zsh: update slave script locations
  completion: prompt: fix color for Zsh
  completion: zsh: fix for command aliasing
  completion: bash: synchronize zsh wrapper
  completion: bash: remove zsh wrapper
  completion: zsh: fix completion for --no-.. options
  completion: fix conflict with bashcomp
  completion: zsh: add missing direct_append
  completion: zsh: fix splitting of words
  completion: zsh: simplify compadd functions
  completion: zsh: simplify direct compadd
  completion: zsh: trivial cleanup
  completion: zsh: simplify nl_append
  completion: zsh: simplify file_direct
  completion: zsh: shuffle functions around
  completion: zsh: refactor command completion
  completion: zsh: improve command tags
  completion: zsh: add alias descriptions
  completion: zsh: trivial simplification
  completion: zsh: add simple version check
  completion: bash: trivial cleanup
  completion: bash: cleanup cygwin check
  completion: bash: remove old compat wrappers
  Update copyright notices

 contrib/completion/git-completion.bash | 113 ++------------------
 contrib/completion/git-completion.zsh  | 141 ++++++++++++++++---------
 contrib/completion/git-prompt.sh       |  11 +-
 t/t9902-completion.sh                  |   2 +-
 4 files changed, 112 insertions(+), 155 deletions(-)

-- 
2.29.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2020-10-29 17:43 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-28  2:06 [PATCH v3 00/29] completion: zsh: latest patches Felipe Contreras
2020-10-28  2:06 ` [PATCH v3 01/29] completion: zsh: fix __gitcomp_direct() Felipe Contreras
2020-10-28  2:06 ` [PATCH v3 02/29] completion: zsh: fix name due to broken autoloading Felipe Contreras
2020-10-28  2:06 ` [PATCH v3 03/29] completion: zsh: fix bash script extension Felipe Contreras
2020-10-28  2:06 ` [PATCH v3 04/29] completion: zsh: reorganize install instructions Felipe Contreras
2020-10-28  2:06 ` [PATCH v3 05/29] completion: zsh: fix for directories with spaces Felipe Contreras
2020-10-28  2:06 ` [PATCH v3 06/29] completion: zsh: update slave script locations Felipe Contreras
2020-10-28  2:06 ` [PATCH v3 07/29] completion: prompt: fix color for Zsh Felipe Contreras
2020-10-28  2:06 ` [PATCH v3 08/29] completion: zsh: fix for command aliasing Felipe Contreras
2020-10-28  2:06 ` [PATCH v3 09/29] completion: bash: synchronize zsh wrapper Felipe Contreras
2020-10-28  2:06 ` [PATCH v3 10/29] completion: bash: remove " Felipe Contreras
2020-10-28  2:06 ` [PATCH v3 11/29] completion: zsh: fix completion for --no-.. options Felipe Contreras
2020-10-28  2:06 ` [PATCH v3 12/29] completion: fix conflict with bashcomp Felipe Contreras
2020-10-28  2:06 ` [PATCH v3 13/29] completion: zsh: add missing direct_append Felipe Contreras
2020-10-28  2:06 ` [PATCH v3 14/29] completion: zsh: fix splitting of words Felipe Contreras
2020-10-28  2:06 ` [PATCH v3 15/29] completion: zsh: simplify compadd functions Felipe Contreras
2020-10-28  2:06 ` [PATCH v3 16/29] completion: zsh: simplify direct compadd Felipe Contreras
2020-10-28  2:07 ` [PATCH v3 17/29] completion: zsh: trivial cleanup Felipe Contreras
2020-10-28  2:07 ` [PATCH v3 18/29] completion: zsh: simplify nl_append Felipe Contreras
2020-10-28  2:07 ` [PATCH v3 19/29] completion: zsh: simplify file_direct Felipe Contreras
2020-10-28  2:07 ` [PATCH v3 20/29] completion: zsh: shuffle functions around Felipe Contreras
2020-10-28  2:07 ` [PATCH v3 21/29] completion: zsh: refactor command completion Felipe Contreras
2020-10-28  2:07 ` [PATCH v3 22/29] completion: zsh: improve command tags Felipe Contreras
2020-10-28  2:07 ` [PATCH v3 23/29] completion: zsh: add alias descriptions Felipe Contreras
2020-10-28  2:07 ` [PATCH v3 24/29] completion: zsh: trivial simplification Felipe Contreras
2020-10-28  2:07 ` [PATCH v3 25/29] completion: zsh: add simple version check Felipe Contreras
2020-10-28  2:07 ` [PATCH v3 26/29] completion: bash: trivial cleanup Felipe Contreras
2020-10-28  2:07 ` [PATCH v3 27/29] completion: bash: cleanup cygwin check Felipe Contreras
2020-10-28  2:07 ` [PATCH v3 28/29] completion: bash: remove old compat wrappers Felipe Contreras
2020-10-28  2:07 ` [PATCH v3 29/29] Update copyright notices Felipe Contreras
2020-10-29 17:43 ` [PATCH v3 00/29] completion: zsh: latest patches Junio C Hamano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.