bash: not all 'git bisect' subcommands make sense when not bisecting
authorSZEDER Gábor <szeder@ira.uka.de>
Sun, 10 Oct 2010 21:39:34 +0000 (23:39 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 13 Oct 2010 22:08:59 +0000 (15:08 -0700)
... but only 'start' and 'replay'. The other commands will either
error out or offer to start bisecting for the user.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/completion/git-completion.bash
index 5e023d415b36b9be380e95e986aa87610f61f9bf..d739113153cce21b2eee6d2f2d62f2ac9b9ea066 100755 (executable)
@@ -907,7 +907,11 @@ _git_bisect ()
        local subcommands="start bad good skip reset visualize replay log run"
        local subcommand="$(__git_find_on_cmdline "$subcommands")"
        if [ -z "$subcommand" ]; then
-               __gitcomp "$subcommands"
+               if [ -f "$(__gitdir)"/BISECT_START ]; then
+                       __gitcomp "$subcommands"
+               else
+                       __gitcomp "replay start"
+               fi
                return
        fi