threads / patch / 20472

patch, 9 partsadd long options completion for 'git checkout'

Subject: [PATCH 1/9] add long options completion for 'git checkout'

## tl;dr

One message between Aug 8, 2009 and Aug 8, 2009. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Emmanuel Trillaud· Aug 8, 2009, 08:55 UTC · lore
add long options completion to git checkout
Signed-off-by: Emmanuel Trillaud <etrillaud@gmail.com>
---
 contrib/completion/git-completion.bash |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)
Show changes to contrib/completion/git-completion.bash +12 −2
diff --git a/contrib/completion/git-completion.bash
b/contrib/completion/git-completion.bash
index 745b5fb..bc5427f 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -815,8 +815,18 @@ _git_bundle ()
 _git_checkout ()
 {
 	__git_has_doubledash && return
-
-	__gitcomp "$(__git_refs)"
+    case "${COMP_WORDS[COMP_CWORD]}" in
+    --*)
+        __gitcomp "
+            --ours --theirs --track --no-track --merge
+            --conflict=
+            "
+            ;;
+    *)
+        __gitcomp "$(__git_refs)"
+        ;;
+    esac
+	
 }

 _git_cherry ()
-- 
1.6.4

← back to recent threads