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

[PATCH 1/2] bash: add 'git svn' subcommands

From
SZEDER Gábor <szeder@ira.uka.de>
Date
Mar 5, 2008, 19:28 UTC
Message-ID
<ad6d56c74f4e5ae29dc8176eba6e7381c12a3351.1204745177.git.szeder@ira.uka.de>
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
---
 contrib/completion/git-completion.bash |   29 ++++++++++++++++++++++++++++-
 1 files changed, 28 insertions(+), 1 deletions(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 23e5994..8f56641 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -384,7 +384,6 @@ __git_commands ()
 		show-index)       : plumbing;;
 		ssh-*)            : transport;;
 		stripspace)       : plumbing;;
-		svn)              : import export;;
 		symbolic-ref)     : plumbing;;
 		tar-tree)         : deprecated;;
 		unpack-file)      : plumbing;;
@@ -1164,6 +1163,32 @@ _git_submodule ()
 	fi
 }
 
+_git_svn ()
+{
+	local i c=1 command
+
+	while [ $c -lt $COMP_CWORD ]; do
+		i="${COMP_WORDS[c]}"
+		case "$i" in
+		init|fetch|clone|rebase|dcommit|log|find-rev|\
+		set-tree|commit-diff|info|\
+		create-ignore|propget|proplist|show-ignore|show-externals)
+			command="$i"
+			break
+			;;
+		esac
+		c=$((++c))
+	done
+
+	if [ $c -eq $COMP_CWORD -a -z "$command" ]; then
+		__gitcomp "
+			init fetch clone rebase dcommit log find-rev
+			set-tree commit-diff info create-ignore propget
+			proplist show-ignore show-externals
+			"
+	fi
+}
+
 _git_tag ()
 {
 	local i c=1 f=0
@@ -1265,6 +1290,7 @@ _git ()
 	show-branch) _git_log ;;
 	stash)       _git_stash ;;
 	submodule)   _git_submodule ;;
+	svn)         _git_svn ;;
 	tag)         _git_tag ;;
 	whatchanged) _git_log ;;
 	*)           COMPREPLY=() ;;
@@ -1315,6 +1341,7 @@ complete -o default -o nospace -F _git_shortlog git-shortlog
 complete -o default -o nospace -F _git_show git-show
 complete -o default -o nospace -F _git_stash git-stash
 complete -o default -o nospace -F _git_submodule git-submodule
+complete -o default -o nospace -F _git_svn git-svn
 complete -o default -o nospace -F _git_log git-show-branch
 complete -o default -o nospace -F _git_tag git-tag
 complete -o default -o nospace -F _git_log git-whatchanged
-- 
1.5.4.3
Next: SZEDER Gábor
Message 1 of 2 in “bash: add 'git svn' subcommands”
  1. 1/2 bash: add 'git svn' subcommandsSZEDER Gábor, Mar 5, 2008
  2. 2/2 bash: add 'git svn' optionsSZEDER Gábor, Mar 5, 2008

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.