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

[PATCH 1/2] bash: add git-branch options

From
SZEDER Gábor <szeder@ira.uka.de>
Date
Mar 4, 2008, 18:00 UTC
Message-ID
<d55a578b4b3f3b7d679b7f8b69497955c7a82a50.1204652001.git.szeder@ira.uka.de>
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
---
 contrib/completion/git-completion.bash |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 8f70e1e..8d6733a 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -506,7 +506,16 @@ _git_bisect ()
 
 _git_branch ()
 {
-	__gitcomp "$(__git_refs)"
+	case "${COMP_WORDS[COMP_CWORD]}" in
+	--*=*)	COMPREPLY=() ;;
+	--*)
+		__gitcomp "
+			--color --no-color --verbose --abbrev= --no-abbrev
+			--track --no-track
+			"
+		;;
+	*)	__gitcomp "$(__git_refs)" ;;
+	esac
 }
 
 _git_bundle ()
-- 
1.5.4.3
Next: SZEDER Gábor
Message 1 of 3 in “bash: add git-branch options”
  1. 1/2 bash: add git-branch optionsSZEDER Gábor, Mar 4, 2008
  2. 2/2 bash: git-branch -d and -m lists only local branchesSZEDER Gábor, Mar 4, 2008
  3. Shawn O. PearceMar 5, 2008

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.