bash: Support git-bisect and its subcommands.
We now offer completion support for git-bisect's subcommands, as well as ref name completion on the good/bad/reset subcommands. This should make interacting with git-bisect slightly easier on the fingers. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Shawn O. Pearce committed
Feb 5, 2007 at 15:44 UTC
b2e69f6299b5a46840600176679b94843cf63a8d
1 file changed
+31
contrib/completion/git-completion.bash
+31
@@ -407,6 +407,35 @@ _git_add ()
407
COMPREPLY=()
408
}
409
410
+_git_bisect ()
411
+{
412
+ local i c=1 command
413
+ while [ $c -lt $COMP_CWORD ]; do
414
+ i="${COMP_WORDS[c]}"
415
+ case "$i" in
416
+ start|bad|good|reset|visualize|replay|log)
417
+ command="$i"
418
+ break
419
+ ;;
420
+ esac
421
+ c=$((++c))
422
+ done
423
+
424
+ if [ $c -eq $COMP_CWORD -a -z "$command" ]; then
425
+ __gitcomp "start bad good reset visualize replay log"
426
+ return
427
+ fi
428
+
429
+ case "$command" in
430
+ bad|good|reset)
431
+ __gitcomp "$(__git_refs)"
432
+ ;;
433
+ *)
434
+ COMPREPLY=()
435
+ ;;
436
+ esac
437
+}
438
+
439
_git_branch ()
440
{
441
__gitcomp "$(__git_refs)"
@@ -884,6 +913,7 @@ _git ()
913
am) _git_am ;;
914
add) _git_add ;;
915
apply) _git_apply ;;
916
+ bisect) _git_bisect ;;
917
branch) _git_branch ;;
918
checkout) _git_checkout ;;
919
cherry) _git_cherry ;;
@@ -928,6 +958,7 @@ complete -o default -o nospace -F _git git
958
complete -o default -o nospace -F _gitk gitk
959
complete -o default -o nospace -F _git_am git-am
960
complete -o default -o nospace -F _git_apply git-apply
961
+complete -o default -o nospace -F _git_bisect git-bisect
962
complete -o default -o nospace -F _git_branch git-branch
963
complete -o default -o nospace -F _git_checkout git-checkout
964
complete -o default -o nospace -F _git_cherry git-cherry