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

[PATCH v4 1/4] zsh completion: find matching custom bash completion

From
Ramkumar Ramachandra <artagnon@gmail.com>
Date
Jan 5, 2014, 10:18 UTC
Message-ID
<1388917085-18701-2-git-send-email-artagnon@gmail.com>
In-Reply-To
<1388917085-18701-1-git-send-email-artagnon@gmail.com>

If zsh completion is being read from a location that is different from system-wide default, it is likely that the user is trying to use a custom version, perhaps closer to the bleeding edge, installed in her own directory. We will more likely to find the matching bash completion script in the same directory than in those system default places.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
---
 contrib/completion/git-completion.zsh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/contrib/completion/git-completion.zsh b/contrib/completion/git-completion.zsh
index fac5e71..6fca145 100644
--- a/contrib/completion/git-completion.zsh
+++ b/contrib/completion/git-completion.zsh
@@ -30,10 +30,10 @@ if [ -z "$script" ]; then
 	local -a locations
 	local e
 	locations=(
+		$(dirname ${funcsourcetrace[1]%:*})/git-completion.bash
 		'/etc/bash_completion.d/git' # fedora, old debian
 		'/usr/share/bash-completion/completions/git' # arch, ubuntu, new debian
 		'/usr/share/bash-completion/git' # gentoo
-		$(dirname ${funcsourcetrace[1]%:*})/git-completion.bash
 		)
 	for e in $locations; do
 		test -f $e && script="$e" && break
-- 
1.8.5.2.227.g53f3478
Previous: Ramkumar RamachandraNext: Ramkumar Ramachandra
Message 2 of 5 in “Re-spin rr/completion-branch-config”
  1. 0/4 Re-spin rr/completion-branch-configRamkumar Ramachandra, Jan 5, 2014
  2. 1/4 zsh completion: find matching custom bash completionRamkumar Ramachandra, Jan 5, 2014
  3. 2/4 completion: introduce __gitcomp_nl_append ()Ramkumar Ramachandra, Jan 5, 2014
  4. 3/4 completion: fix branch.autosetup(merge|rebase)Ramkumar Ramachandra, Jan 5, 2014
  5. 4/4 completion: fix remote.pushdefaultRamkumar Ramachandra, Jan 5, 2014

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.