From: SZEDER Gábor Date: Sun, 10 Oct 2010 21:39:34 +0000 (+0200) Subject: bash: not all 'git bisect' subcommands make sense when not bisecting X-Git-Tag: v1.7.4-rc0~140^2~2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/128191f5eec4365c4798d2bc8ef86008edb7d1bb?ds=sidebyside;hp=8205ff8e9957039d508b5702e3b45fc9c4a55648 bash: not all 'git bisect' subcommands make sense when not bisecting ... 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 Signed-off-by: Junio C Hamano --- diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 5e023d415b..d739113153 100755 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -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