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

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

From
ETEmmanuel Trillaud <etrillaud@gmail.com>
Date
Aug 8, 2009, 08:55 UTC
Message-ID
<9f50533b0908080155o45163caby4f91b05ac1152a81@mail.gmail.com>
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(-)
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
Message 1 of 1 in “add long options completion for 'git checkout'”
  1. 1/9 add long options completion for 'git checkout'Emmanuel Trillaud, Aug 8, 2009

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.