git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] bash: rename __git_find_subcommand() to __git_find_on_cmdline()
@ 2009-09-15 10:21 SZEDER Gábor
  2009-09-15 10:21 ` [PATCH 2/4] bash: update 'git stash' completion SZEDER Gábor
  0 siblings, 1 reply; 7+ messages in thread
From: SZEDER Gábor @ 2009-09-15 10:21 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: git, Junio C Hamano, SZEDER Gábor

__git_find_subcommand() was originally meant to check whether
subcommands are already present on the command line.  But the code is
general enough to be used for checking the presence of command line
options as well, and the next commit will use it for that purpose, so
let's give it a more general name.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
---
 contrib/completion/git-completion.bash |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index f47c519..c539385 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -619,8 +619,8 @@ __git_aliased_command ()
 	done
 }
 
-# __git_find_subcommand requires 1 argument
-__git_find_subcommand ()
+# __git_find_on_cmdline requires 1 argument
+__git_find_on_cmdline ()
 {
 	local word subcommand c=1
 
@@ -739,7 +739,7 @@ _git_bisect ()
 	__git_has_doubledash && return
 
 	local subcommands="start bad good skip reset visualize replay log run"
-	local subcommand="$(__git_find_subcommand "$subcommands")"
+	local subcommand="$(__git_find_on_cmdline "$subcommands")"
 	if [ -z "$subcommand" ]; then
 		__gitcomp "$subcommands"
 		return
@@ -1751,7 +1751,7 @@ _git_config ()
 _git_remote ()
 {
 	local subcommands="add rename rm show prune update set-head"
-	local subcommand="$(__git_find_subcommand "$subcommands")"
+	local subcommand="$(__git_find_on_cmdline "$subcommands")"
 	if [ -z "$subcommand" ]; then
 		__gitcomp "$subcommands"
 		return
@@ -1879,7 +1879,7 @@ _git_show_branch ()
 _git_stash ()
 {
 	local subcommands='save list show apply clear drop pop create branch'
-	local subcommand="$(__git_find_subcommand "$subcommands")"
+	local subcommand="$(__git_find_on_cmdline "$subcommands")"
 	if [ -z "$subcommand" ]; then
 		__gitcomp "$subcommands"
 	else
@@ -1910,7 +1910,7 @@ _git_submodule ()
 	__git_has_doubledash && return
 
 	local subcommands="add status init update summary foreach sync"
-	if [ -z "$(__git_find_subcommand "$subcommands")" ]; then
+	if [ -z "$(__git_find_on_cmdline "$subcommands")" ]; then
 		local cur="${COMP_WORDS[COMP_CWORD]}"
 		case "$cur" in
 		--*)
@@ -1932,7 +1932,7 @@ _git_svn ()
 		proplist show-ignore show-externals branch tag blame
 		migrate
 		"
-	local subcommand="$(__git_find_subcommand "$subcommands")"
+	local subcommand="$(__git_find_on_cmdline "$subcommands")"
 	if [ -z "$subcommand" ]; then
 		__gitcomp "$subcommands"
 	else
-- 
1.6.5.rc1.92.gee3c1

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

end of thread, other threads:[~2009-09-24 12:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-15 10:21 [PATCH 1/4] bash: rename __git_find_subcommand() to __git_find_on_cmdline() SZEDER Gábor
2009-09-15 10:21 ` [PATCH 2/4] bash: update 'git stash' completion SZEDER Gábor
2009-09-15 10:21   ` [PATCH 3/4] bash: teach 'git reset --patch' SZEDER Gábor
2009-09-15 10:21     ` [PATCH 4/4] bash: teach 'git checkout' options SZEDER Gábor
2009-09-22 15:28       ` Shawn O. Pearce
2009-09-24 12:23         ` [PATCHv2] " SZEDER Gábor
2009-09-22 15:29     ` [PATCH 3/4] bash: teach 'git reset --patch' Shawn O. Pearce

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).