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

[PATCHv2] bash: teach 'git checkout' options

From
SZEDER Gábor <szeder@ira.uka.de>
Date
Sep 24, 2009, 12:23 UTC
Message-ID
<1253794995-9093-1-git-send-email-szeder@ira.uka.de>
In-Reply-To
<20090922152846.GQ14660@spearce.org>
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
---
 contrib/completion/git-completion.bash |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 8c268a1..a08e471 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -809,7 +809,21 @@ _git_checkout ()
 {
 	__git_has_doubledash && return
 
-	__gitcomp "$(__git_refs)"
+	local cur="${COMP_WORDS[COMP_CWORD]}"
+	case "$cur" in
+	--conflict=*)
+		__gitcomp "diff3 merge" "" "${cur##--conflict=}"
+		;;
+	--*)
+		__gitcomp "
+			--quiet --ours --theirs --track --no-track --merge
+			--conflict= --patch
+			"
+		;;
+	*)
+		__gitcomp "$(__git_refs)"
+		;;
+	esac
 }
 
 _git_cherry ()
-- 
1.6.5.rc2.85.gd02ad
Previous: Shawn O. PearceNext: Shawn O. Pearce
Message 6 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.