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

[BUG, PATCH] bisect and tags

From
Uwe Kleine-König <ukleinek@informatik.uni-freiburg.de>
Date
Mar 22, 2007, 16:18 UTC
Message-ID
<20070322161808.GA18791@informatik.uni-freiburg.de>
Hello,
zeisberg@cassiopeia:~/gsrc/test$ git init
Initialized empty Git repository in .git/
zeisberg@cassiopeia:~/gsrc/test$ echo 0 > 0
zeisberg@cassiopeia:~/gsrc/test$ git add 0
zeisberg@cassiopeia:~/gsrc/test$ git commit -m 0
Created initial commit fa8382e1b0a75f2abd5b8961ba88caa65e6e0ddc
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 0
zeisberg@cassiopeia:~/gsrc/test$ echo 1 > 1
zeisberg@cassiopeia:~/gsrc/test$ git add 1
zeisberg@cassiopeia:~/gsrc/test$ git commit -m 1
Created commit bf00881b13efd325f87899f0fd072566629aedb0
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 1
zeisberg@cassiopeia:~/gsrc/test$ git tag -m tag tag
zeisberg@cassiopeia:~/gsrc/test$ git bisect start
zeisberg@cassiopeia:~/gsrc/test$ git bisect good HEAD^
zeisberg@cassiopeia:~/gsrc/test$ git bisect bad tag
Bisecting: 1 revisions left to test after this
[bf00881b13efd325f87899f0fd072566629aedb0] 1

Actually the case is already clear here. But bisect fails to detect that because it doesn't see that tag^{commit} is bad, only tag itself.

--- 8< ---
Bisect: convert revs given to good and bad to commits

Without this the rev could be (e.g.) a tag and then the condition to end the bisect might fail and you have to check the already known to be bad revision once more.

Signed-off-by: Uwe Kleine-König <ukleinek@informatik.uni-freiburg.de>
---
 git-bisect.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/git-bisect.sh b/git-bisect.sh
index b1c3a6b..dbce0df 100755
--- a/git-bisect.sh
+++ b/git-bisect.sh
@@ -85,7 +85,7 @@ bisect_bad() {
 	0)
 		rev=$(git-rev-parse --verify HEAD) ;;
 	1)
-		rev=$(git-rev-parse --verify "$1") ;;
+		rev=$(git-rev-parse --verify "$1^{commit}") ;;
 	*)
 		usage ;;
 	esac || exit
@@ -104,7 +104,7 @@ bisect_good() {
 	esac
 	for rev in $revs
 	do
-		rev=$(git-rev-parse --verify "$rev") || exit
+		rev=$(git-rev-parse --verify "$rev^{commit}") || exit
 		echo "$rev" >"$GIT_DIR/refs/bisect/good-$rev"
 		echo "# good: "$(git-show-branch $rev) >>"$GIT_DIR/BISECT_LOG"
 		echo "git-bisect good $rev" >>"$GIT_DIR/BISECT_LOG"
-- 
1.5.1.rc1.27.g1d848

-- 
Uwe Kleine-König

http://www.google.com/search?q=1+newton+in+kg*m+%2F+s%5E2
Message 1 of 1 in “bisect and tags”
  1. bisect and tagsUwe Kleine-König, Mar 22, 2007

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.