Skip to content

Commit

Permalink
bash: Remove short option completions for branch/checkout/diff.
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Shawn O. Pearce authored and Junio C Hamano committed Feb 4, 2007
1 parent 8d0fc48 commit 9f4cc6f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions contrib/completion/git-completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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 ()
Expand All @@ -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 ()
Expand Down Expand Up @@ -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 ()
Expand Down

0 comments on commit 9f4cc6f

Please sign in to comment.