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

Re: git-bisect failure

From
Linus Torvalds <torvalds@osdl.org>
Date
Sep 10, 2005, 21:32 UTC
Message-ID
<Pine.LNX.4.58.0509101428490.30958@g5.osdl.org>
In-Reply-To
<20050910141343.578649c7.akpm@osdl.org>
On Sat, 10 Sep 2005, Andrew Morton wrote:
> 
> Yup.  Simply keeping a little log file would suffice.
This is a _very_ cheesy and untested patch.

Oh, btw, it also fixes "git bisect reset" - we used to remove the file "refs/reads/bisect", not "refs/heads/bisect".

Cheesy, cheesy, cheesy,
		Linus "not proud" Torvalds
---
Subject: Keep bisect event log

This keeps an event log in refs/bisect/log, which tracks what bisections have been done. We could eventually have a "git bisect replay" or somethign similar that actually uses it - for now we just have a command to show the log: "git bisect log".

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
---
diff --git a/git-bisect.sh b/git-bisect.sh
--- a/git-bisect.sh
+++ b/git-bisect.sh
@@ -8,7 +8,8 @@ git bisect bad [<rev>]		mark <rev> a kno
 git bisect good [<rev>...]	mark <rev>... known-good revisions.
 git bisect next			find next bisection to test and check it out.
 git bisect reset [<branch>]	finish bisection search and go back to branch.
-git bisect visualize            show bisect status in gitk.'
+git bisect visualize            show bisect status in gitk.
+git bisect log                  show bisect log.'
     exit 1
 }
 
@@ -67,6 +68,7 @@ bisect_bad() {
 		usage ;;
 	esac || exit
 	echo "$rev" > "$GIT_DIR/refs/bisect/bad"
+	echo "bad $rev" >> "$GIT_DIR/refs/bisect/log"
 	bisect_auto_next
 }
 
@@ -81,6 +83,7 @@ bisect_good() {
 	do
 		rev=$(git-rev-parse --verify "$rev") || exit
 		echo "$rev" >"$GIT_DIR/refs/bisect/good-$rev"
+		echo "good $rev" >> "$GIT_DIR/refs/bisect/log"
 	done
 	bisect_auto_next
 }
@@ -149,7 +152,11 @@ bisect_reset() {
 	esac
 	git checkout "$branch" &&
 	rm -fr "$GIT_DIR/refs/bisect"
-	rm -f "$GIT_DIR/refs/reads/bisect"
+	rm -f "$GIT_DIR/refs/heads/bisect"
+}
+
+bisect_log() {
+	cat "$GIT_DIR/refs/bisect/log"
 }
 
 case "$#" in
@@ -172,6 +179,8 @@ case "$#" in
 	bisect_visualize "$@" ;;
     reset)
         bisect_reset "$@" ;;
+    log)
+        bisect_log "$@" ;;
     *)
         usage ;;
     esac
Previous: Andrew MortonNext: Junio C Hamano
Message 7 of 9 in “git-bisect failure”
  1. Andrew MortonSep 9, 2005
  2. Junio C HamanoSep 9, 2005
  3. Junio C HamanoSep 10, 2005
  4. Andrew MortonSep 10, 2005
  5. Linus TorvaldsSep 10, 2005
  6. Andrew MortonSep 10, 2005
  7. Linus TorvaldsSep 10, 2005
  8. Junio C HamanoSep 10, 2005
  9. Junio C HamanoSep 10, 2005

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.