git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[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
Previous: SZEDER GáborNext: Sverre Rabbelier
Message 2 of 5 in “bash: offer refs for 'git bisect start'”
  1. 1/2 bash: offer refs for 'git bisect start'SZEDER Gábor, Oct 10, 2010
  2. 2/2 bash: not all 'git bisect' subcommands make sense when not bisectingSZEDER Gábor, Oct 10, 2010
  3. Sverre RabbelierOct 10, 2010
  4. SZEDER GáborOct 10, 2010
  5. Sverre RabbelierOct 10, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.