[PATCH 2/2] bash: not all 'git bisect' subcommands make sense when not bisecting
- From
SZEDER Gábor <szeder@ira.uka.de>
- Date
- Oct 10, 2010, 21:39 UTC
- Message-ID
- <1286746774-7877-2-git-send-email-szeder@ira.uka.de>
- In-Reply-To
- <1286746774-7877-1-git-send-email-szeder@ira.uka.de>
... 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> --- contrib/completion/git-completion.bash | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index eb8ef47..1262f72 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
-- 1.7.3.1.148.g2fffa