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

[PATCH 1/8] bash: Remove short option completions for branch/checkout/diff.

From
Shawn O. Pearce <spearce@spearce.org>
Date
Feb 4, 2007, 07:38 UTC
Message-ID
<20070204073817.GA17603@spearce.org>

The short options (-l, -f, -d) for git-branch are rather silly to include in the completion generation as these options must be fully typed out by the user and most users already know what the options are anyway, so including them in the suggested completions does not offer huge value. (The same goes for git-checkout and git-diff.)

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
 contrib/completion/git-completion.bash |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 83c69ec..971fefb 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -359,7 +359,7 @@ _git_apply ()
 _git_branch ()
 {
 	local cur="${COMP_WORDS[COMP_CWORD]}"
-	COMPREPLY=($(compgen -W "-l -f -d -D $(__git_refs)" -- "$cur"))
+	COMPREPLY=($(compgen -W "$(__git_refs)" -- "$cur"))
 }
 
 _git_cat_file ()
@@ -381,7 +381,7 @@ _git_cat_file ()
 _git_checkout ()
 {
 	local cur="${COMP_WORDS[COMP_CWORD]}"
-	COMPREPLY=($(compgen -W "-l -b $(__git_refs)" -- "$cur"))
+	COMPREPLY=($(compgen -W "$(__git_refs)" -- "$cur"))
 }
 
 _git_cherry_pick ()
@@ -421,7 +421,7 @@ _git_diff ()
 _git_diff_tree ()
 {
 	local cur="${COMP_WORDS[COMP_CWORD]}"
-	COMPREPLY=($(compgen -W "-r -p -M $(__git_refs)" -- "$cur"))
+	COMPREPLY=($(compgen -W "$(__git_refs)" -- "$cur"))
 }
 
 _git_fetch ()
-- 
1.5.0.rc3.22.g5057
Next: Jakub Narebski
Message 1 of 6 in “bash: Remove short option completions for branch/checkout/diff.”
  1. 1/8 bash: Remove short option completions for branch/checkout/diff.Shawn O. Pearce, Feb 4, 2007
  2. Jakub NarebskiFeb 4, 2007
  3. Junio C HamanoFeb 4, 2007
  4. Shawn O. PearceFeb 5, 2007
  5. Jakub NarebskiFeb 5, 2007
  6. Shawn O. PearceFeb 5, 2007

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.