[PATCH] git-completion.bash - add support for git-bundle

Subsystems: the rest

DORMANTno replies

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

[PATCH] git-completion.bash - add support for git-bundle

From: Mark Levedahl <hidden>
Date: 2016-06-15 22:43:29

Signed-off-by: Mark Levedahl <redacted>
---
 contrib/completion/git-completion.bash |   32 ++++++++++++++++++++++++++++++++
 1 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 82b9ed4..52b2893 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -459,6 +459,35 @@ _git_branch ()
 	__gitcomp "$(__git_refs)"
 }
 
+_git_bundle ()
+{
+	local mycword="$COMP_CWORD"
+	case "${COMP_WORDS[0]}" in
+	git)
+		local cmd="${COMP_WORDS[2]}"
+		mycword="$((mycword-1))"
+		;;
+	git-bundle*)
+		local cmd="${COMP_WORDS[1]}"
+		;;
+	esac
+	case "$mycword" in
+	1)
+		__gitcomp "create list-heads verify unbundle"
+		;;
+	2)
+		# looking for a file
+		;;
+	*)
+		case "$cmd" in
+			create)
+				__git_complete_revlist
+			;;
+		esac
+		;;
+	esac
+}
+
 _git_checkout ()
 {
 	__gitcomp "$(__git_refs)"
@@ -1009,6 +1038,7 @@ _git ()
 	add)         _git_add ;;
 	apply)       _git_apply ;;
 	bisect)      _git_bisect ;;
+	bundle)      _git_bundle ;;
 	branch)      _git_branch ;;
 	checkout)    _git_checkout ;;
 	cherry)      _git_cherry ;;
@@ -1057,6 +1087,7 @@ complete -o default -o nospace -F _git_am git-am
 complete -o default -o nospace -F _git_apply git-apply
 complete -o default -o nospace -F _git_bisect git-bisect
 complete -o default -o nospace -F _git_branch git-branch
+complete -o default -o nospace -F _git_bundle git-bundle
 complete -o default -o nospace -F _git_checkout git-checkout
 complete -o default -o nospace -F _git_cherry git-cherry
 complete -o default -o nospace -F _git_cherry_pick git-cherry-pick
@@ -1092,6 +1123,7 @@ complete -o default -o nospace -F _git_add git-add.exe
 complete -o default -o nospace -F _git_apply git-apply.exe
 complete -o default -o nospace -F _git git.exe
 complete -o default -o nospace -F _git_branch git-branch.exe
+complete -o default -o nospace -F _git_bundle git-bundle.exe
 complete -o default -o nospace -F _git_cherry git-cherry.exe
 complete -o default -o nospace -F _git_diff git-diff.exe
 complete -o default -o nospace -F _git_format_patch git-format-patch.exe
-- 
1.5.3.rc4.80.ge600

Re: [PATCH] git-completion.bash - add support for git-bundle

From: Shawn O. Pearce <hidden>
Date: 2016-06-15 22:43:29

Mark Levedahl [off-list ref] wrote:
Signed-off-by: Mark Levedahl <redacted>
---
 contrib/completion/git-completion.bash |   32 ++++++++++++++++++++++++++++++++
 1 files changed, 32 insertions(+), 0 deletions(-)
Thanks!  Its applied locally, I'll ask Junio to pull it shortly,
along with a few updates for fast-import that have been lagging
behind the main tree for some time.
 
-- 
Shawn.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help