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

[PATCH 4/4] bash: teach 'git checkout' options

From
SZEDER Gábor <szeder@ira.uka.de>
Date
Sep 15, 2009, 10:21 UTC
Message-ID
<7c8c4f6a4c581bcba101b8ca467d241738aa376e.1253009868.git.szeder@ira.uka.de>
In-Reply-To
<ccf129a01115027ee7438ac47f1bc35631a1b2bb.1253009868.git.szeder@ira.uka.de>
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
---
 contrib/completion/git-completion.bash |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 8c268a1..8e3cdbd 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -809,7 +809,18 @@ _git_checkout ()
 {
 	__git_has_doubledash && return
 
-	__gitcomp "$(__git_refs)"
+	local cur="${COMP_WORDS[COMP_CWORD]}"
+	case "$cur" in
+	--*)
+		__gitcomp "
+			--quiet --ours --theirs --track --no-track --merge
+			--conflict= --patch
+			"
+		;;
+	*)
+		__gitcomp "$(__git_refs)"
+		;;
+	esac
 }
 
 _git_cherry ()
-- 
1.6.5.rc1.92.gee3c1
Previous: SZEDER GáborNext: Shawn O. Pearce
Message 4 of 7 in “bash: rename __git_find_subcommand() to __git_find_on_cmdline()”
  1. 1/4 bash: rename __git_find_subcommand() to __git_find_on_cmdline()SZEDER Gábor, Sep 15, 2009
  2. 2/4 bash: update 'git stash' completionSZEDER Gábor, Sep 15, 2009
  3. 3/4 bash: teach 'git reset --patch'SZEDER Gábor, Sep 15, 2009
  4. 4/4 bash: teach 'git checkout' optionsSZEDER Gábor, Sep 15, 2009
  5. Shawn O. PearceSep 22, 2009
  6. [PATCHv2] bash: teach 'git checkout' optionsSZEDER Gábor, Sep 24, 2009
  7. Shawn O. PearceSep 22, 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.