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

[RFC PATCH v2 1/2] bisect: split out replay file parsing

From
Adam Dinwoodie <adam@dinwoodie.org>
Date
Nov 20, 2017, 18:24 UTC
Message-ID
<e3bfd0ab1f7b17eb43cf50c91e17f498db56cdee.1511200589.git.adam@dinwoodie.org>
In-Reply-To
<cover.1511200589.git.adam@dinwoodie.org>

In order to allow a git bisect log file to be replayed without using all the surrounding code to do things like clean the repository state, split out the file-parsing part of bisect_replay into a separate function.

Signed-off-by: Adam Dinwoodie <adam@dinwoodie.org>
---
 git-bisect.sh | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/git-bisect.sh b/git-bisect.sh
index 54cbfecc5..895d7976a 100755
--- a/git-bisect.sh
+++ b/git-bisect.sh
@@ -422,6 +422,14 @@ bisect_replay () {
 	test "$#" -eq 1 || die "$(gettext "No logfile given")"
 	test -r "$file" || die "$(eval_gettext "cannot read \$file for replaying")"
 	bisect_reset
+	bisect_replay_file "$file"
+	bisect_auto_next
+}
+
+bisect_replay_file() {
+	file="$1"
+	test "$#" -eq 1 || die "$(gettext "No logfile given")"
+	test -r "$file" || die "$(eval_gettext "cannot read \$file for replaying")"
 	while read git bisect command rev
 	do
 		test "$git $bisect" = "git bisect" || test "$git" = "git-bisect" || continue
@@ -444,7 +452,6 @@ bisect_replay () {
 			die "$(gettext "?? what are you talking about?")" ;;
 		esac
 	done <"$file"
-	bisect_auto_next
 }
 
 bisect_run () {
-- 
2.15.0.281.g87c0a7615
Previous: Adam DinwoodieNext: Adam Dinwoodie
Message 7 of 9 in “rebisect: add script for easier bisect log editing”
  1. rebisect: add script for easier bisect log editingAdam Dinwoodie, Nov 8, 2017
  2. Christian CouderNov 8, 2017
  3. Christian CouderNov 8, 2017
  4. Adam DinwoodieNov 8, 2017
  5. Adam DinwoodieNov 8, 2017
  6. 0/2 bisect: add a single command for editing logsAdam Dinwoodie, Nov 20, 2017
  7. 1/2 bisect: split out replay file parsingAdam Dinwoodie, Nov 20, 2017
  8. 2/2 bisect: add "edit" commandAdam Dinwoodie, Nov 20, 2017
  9. Junio C HamanoNov 22, 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.