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

[PATCH 1/2] completion: rename _git and _gitk

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
May 19, 2012, 02:41 UTC
Message-ID
<1337395295-29162-2-git-send-email-felipe.contreras@gmail.com>
In-Reply-To
<1337395295-29162-1-git-send-email-felipe.contreras@gmail.com>

Would be useful to provide backwards compatibility for _git. Also, zsh completion uses _git, and it cannot be changed.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 contrib/completion/git-completion.bash |   10 +++++-----
 t/t9902-completion.sh                  |    2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index cd92322..3cb106e 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -2597,7 +2597,7 @@ _git_whatchanged ()
 	_git_log
 }
 
-_git ()
+_main_git ()
 {
 	local i c=1 command __git_dir
 
@@ -2648,7 +2648,7 @@ _git ()
 	fi
 }
 
-_gitk ()
+_main_gitk ()
 {
 	__git_has_doubledash && return
 
@@ -2700,13 +2700,13 @@ __git_complete ()
 		|| complete -o default -o nospace -F $wrapper $1
 }
 
-__git_complete git _git
-__git_complete gitk _gitk
+__git_complete git _main_git
+__git_complete gitk _main_gitk
 
 # The following are necessary only for Cygwin, and only are needed
 # when the user has tab-completed the executable name and consequently
 # included the '.exe' suffix.
 #
 if [ Cygwin = "$(uname -o 2>/dev/null)" ]; then
-__git_complete git.exe _git
+__git_complete git.exe _main_git
 fi
diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh
index 0f09fd6..9a80c60 100755
--- a/t/t9902-completion.sh
+++ b/t/t9902-completion.sh
@@ -63,7 +63,7 @@ run_completion ()
 	local _cword
 	_words=( $1 )
 	(( _cword = ${#_words[@]} - 1 ))
-	__git_wrap_git && print_comp
+	__git_wrap_main_git && print_comp
 }
 
 test_completion ()
-- 
1.7.10.2
Previous: Felipe ContrerasNext: SZEDER Gábor
Message 2 of 14 in “completion: backwards compatibility fix”
  1. 0/2 completion: backwards compatibility fixFelipe Contreras, May 19, 2012
  2. 1/2 completion: rename _git and _gitkFelipe Contreras, May 19, 2012
  3. SZEDER GáborMay 22, 2012
  4. Junio C HamanoMay 22, 2012
  5. Felipe ContrerasMay 22, 2012
  6. 2/2 completion: add support for backwards compatibilityFelipe Contreras, May 19, 2012
  7. Jeff KingMay 19, 2012
  8. Carsten MattnerMay 19, 2012
  9. Jeff KingMay 19, 2012
  10. Carsten MattnerMay 19, 2012
  11. Junio C HamanoMay 20, 2012
  12. Carsten MattnerMay 20, 2012
  13. Felipe ContrerasMay 20, 2012
  14. Carsten MattnerMay 20, 2012

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.