git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <ukleinek@informatik.uni-freiburg.de>
To: git@vger.kernel.org
Subject: [BUG, PATCH] bisect and tags
Date: Thu, 22 Mar 2007 17:18:08 +0100	[thread overview]
Message-ID: <20070322161808.GA18791@informatik.uni-freiburg.de> (raw)

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

                 reply	other threads:[~2007-03-22 16:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070322161808.GA18791@informatik.uni-freiburg.de \
    --to=ukleinek@informatik.uni-freiburg.de \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).