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

[RFC PATCH] rebisect: add script for easier bisect log editing

From
Adam Dinwoodie <adam@dinwoodie.org>
Date
Nov 8, 2017, 13:59 UTC
Message-ID
<20171108135931.166880-1-adam@dinwoodie.org>

Add a short script, vaguely inspired by `git rebase --interactive`, to ease the process described in the `git bisect` documentation of saving off a bisect log, editing it, then replaying it.

Signed-off-by: Adam Dinwoodie <adam@dinwoodie.org>
---

When I'm bisecting, I find I need to semi-regularly go back and change my good/bad/skip response for some commits. The bisect documentation describes doing this by saving `git bisect log` output, editing it, then using `git bisect replay`. Which is a perfectly fine technique, but automation is A Good Thing(TM). The below script is a short proof of concept for changing this process to be a single command.

Ideally (at least from my perspective), this function would be rolled into the main `git bisect` tool, as `git bisect edit` or similar. Before I start working on that, however, I wanted to see what the list thought of the idea.

 contrib/git-rebisect.sh | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100755 contrib/git-rebisect.sh
diff --git a/contrib/git-rebisect.sh b/contrib/git-rebisect.sh
new file mode 100755
index 000000000..60f20b278
--- /dev/null
+++ b/contrib/git-rebisect.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+GIT_EDITOR="$(git var GIT_EDITOR)"
+GIT_DIR="$(git rev-parse --git-dir)"
+GIT_BISECT_LOG_TMP="${GIT_DIR}/BISECT_LOG_EDIT"
+
+git bisect log >"$GIT_BISECT_LOG_TMP"
+"$GIT_EDITOR" "$GIT_BISECT_LOG_TMP"
+git bisect reset HEAD
+git bisect start
+git bisect replay "$GIT_BISECT_LOG_TMP"
+rm -f "$GIT_BISECT_LOG_TMP"
-- 
2.14.3
Next: Christian Couder
Message 1 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.