[BUG, PATCH] bisect and tags

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxxxxxxxxxx>
---
 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
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]