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

[PATCH] bisect: add quit command

From
Edmundo Carmona Antoranz <eantoranz@gmail.com>
Date
Mar 25, 2017, 21:17 UTC
Message-ID
<20170325211709.21265-1-eantoranz@gmail.com>
git bisect quit will call git reset HEAD so that the working tree
remains at the current revision
---
 Documentation/git-bisect.txt | 12 ++++++++++++
 git-bisect.sh                | 11 ++++++++++-
 2 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/Documentation/git-bisect.txt b/Documentation/git-bisect.txt
index bdd915a66..de79e9e44 100644
--- a/Documentation/git-bisect.txt
+++ b/Documentation/git-bisect.txt
@@ -23,6 +23,7 @@ on the subcommand:
  git bisect terms [--term-good | --term-bad]
  git bisect skip [(<rev>|<range>)...]
  git bisect reset [<commit>]
+ git bisect quit
  git bisect visualize
  git bisect replay <logfile>
  git bisect log
@@ -120,6 +121,17 @@ bad revision, while `git bisect reset HEAD` will leave you on the
 current bisection commit and avoid switching commits at all.
 
 
+Bisect quit
+~~~~~~~~~~~
+
+It's an equivalent of bisect reset but that stays at the current
+revision instead of taking your working tree to the starting revision.
+
+------------------------------------------------
+$ git bisect quit
+------------------------------------------------
+
+
 Alternate terms
 ~~~~~~~~~~~~~~~
 
diff --git a/git-bisect.sh b/git-bisect.sh
index ae3cb013e..adbff2c69 100755
--- a/git-bisect.sh
+++ b/git-bisect.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-USAGE='[help|start|bad|good|new|old|terms|skip|next|reset|visualize|replay|log|run]'
+USAGE='[help|start|bad|good|new|old|terms|skip|next|quit|reset|visualize|replay|log|run]'
 LONG_USAGE='git bisect help
 	print this long help message.
 git bisect start [--term-{old,good}=<term> --term-{new,bad}=<term>]
@@ -20,6 +20,9 @@ git bisect next
 	find next bisection to test and check it out.
 git bisect reset [<commit>]
 	finish bisection search and go back to commit.
+git bisect quit
+	stop bisection on its tracks and stay on current revision.
+	Equivalent to git bisect reset HEAD
 git bisect visualize
 	show bisect status in gitk.
 git bisect replay <logfile>
@@ -433,6 +436,10 @@ Try 'git bisect reset <commit>'.")"
 	bisect_clean_state
 }
 
+bisect_quit() {
+	bisect_reset "HEAD"
+}
+
 bisect_clean_state() {
 	# There may be some refs packed during bisection.
 	git for-each-ref --format='%(refname) %(objectname)' refs/bisect/\* |
@@ -683,6 +690,8 @@ case "$#" in
 		bisect_visualize "$@" ;;
 	reset)
 		bisect_reset "$@" ;;
+	quit)
+		bisect_quit ;;
 	replay)
 		bisect_replay "$@" ;;
 	log)
-- 
2.11.0.rc1
Next: Edmundo Carmona Antoranz
Message 1 of 2 in “bisect: add quit command”
  1. bisect: add quit commandEdmundo Carmona Antoranz, Mar 25, 2017
  2. Edmundo Carmona AntoranzMar 25, 2017

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.