git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [BUG, PATCH] bisect and tags
@ 2007-03-22 16:18 Uwe Kleine-König
  0 siblings, 0 replies; only message in thread
From: Uwe Kleine-König @ 2007-03-22 16:18 UTC (permalink / raw
  To: git

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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2007-03-22 16:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-22 16:18 [BUG, PATCH] bisect and tags Uwe Kleine-König

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).