From: Carl Worth <cworth@cworth.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: Mike Galbraith <efault@gmx.de>, git <git@vger.kernel.org>
Subject: Re: [PATCH] Eliminate confusing "won't bisect on seeked tree" failure
Date: Sat, 23 Feb 2008 10:33:33 -0800 [thread overview]
Message-ID: <87oda7o742.wl%cworth@cworth.org> (raw)
In-Reply-To: <7v63wgap10.fsf@gitster.siamese.dyndns.org>
[-- Attachment #1: Type: text/plain, Size: 3197 bytes --]
This error message is very confusing---it doesn't tell the user
anything about how to fix the situation. And the actual fix
for the situation ("git bisect reset") does a checkout of a
potentially random branch, (compared to what the user wants to
be on for the bisect she is starting).
The simplest way to eliminate the confusion is to just make
"git bisect start" do the cleanup itself. There's no significant
loss of safety here since we already have a general safety in
the form of the reflog.
Note: We preserve the warning for any cogito users. We do this
by switching from .git/head-name to .git/BISECT_START for the
extra state, (which is a more descriptive name anyway).
Signed-off-by: Carl Worth <cworth@cworth.org>
---
On Fri, 22 Feb 2008 09:18:03 -0800, Junio C Hamano wrote:
> The message itself refers to a Cogito "feature" and I suspect
> that removing the check and refusal would confuse Cogito. While
> I think the patch itself is Ok for us, we may want to wait a bit
> for a while. until Cogito users all die out.
To avoid confusing cogito, this version preserves the error if
there is a .git/head-name file around from cg-seek, and instead
uses .git/BISECT_START for the git-bisect state.
Does this seem safe enough, Junio?
I suppose this does mean that cogito won't consider the tree to
be in a "seeked" state during a git-bisect session, but hopefully
that's not a big problem.
Any cogito users around that really care one way or the other on
this stuff?
-Carl
git-bisect.sh | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/git-bisect.sh b/git-bisect.sh
index 74715ed..4b13388 100755
--- a/git-bisect.sh
+++ b/git-bisect.sh
@@ -67,16 +67,18 @@ bisect_start() {
die "Bad HEAD - I need a HEAD"
case "$head" in
refs/heads/bisect)
- if [ -s "$GIT_DIR/head-name" ]; then
- branch=`cat "$GIT_DIR/head-name"`
+ if [ -s "$GIT_DIR/BISECT_START" ]; then
+ branch=`cat "$GIT_DIR/BISECT_START"`
else
branch=master
fi
git checkout $branch || exit
;;
refs/heads/*|$_x40)
+ # This error message should only be triggered by cogito usage,
+ # and cogito users should understand it relates to cg-seek.
[ -s "$GIT_DIR/head-name" ] && die "won't bisect on seeked tree"
- echo "${head#refs/heads/}" >"$GIT_DIR/head-name"
+ echo "${head#refs/heads/}" >"$GIT_DIR/BISECT_START"
;;
*)
die "Bad HEAD - strange symbolic ref"
@@ -353,8 +355,8 @@ bisect_reset() {
return
}
case "$#" in
- 0) if [ -s "$GIT_DIR/head-name" ]; then
- branch=`cat "$GIT_DIR/head-name"`
+ 0) if [ -s "$GIT_DIR/BISECT_START" ]; then
+ branch=`cat "$GIT_DIR/BISECT_START"`
else
branch=master
fi ;;
@@ -365,7 +367,6 @@ bisect_reset() {
usage ;;
esac
if git checkout "$branch"; then
- rm -f "$GIT_DIR/head-name"
bisect_clean_state
fi
}
@@ -377,6 +378,9 @@ bisect_clean_state() {
do
git update-ref -d $ref $hash
done
+ # Cleanup head-name if it got left by an old version of git-bisect
+ rm -f "$GIT_DIR/head-name"
+ rm -f "$GIT_DIR/BISECT_START"
rm -f "$GIT_DIR/BISECT_LOG"
rm -f "$GIT_DIR/BISECT_NAMES"
rm -f "$GIT_DIR/BISECT_RUN"
--
1.5.4.1
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2008-02-23 18:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-21 5:20 bisect: "won't bisect on seeked tree" Mike Galbraith
2008-02-21 5:33 ` Shawn O. Pearce
2008-02-21 5:39 ` Mike Galbraith
2008-02-21 5:43 ` Shawn O. Pearce
2008-02-21 6:00 ` Mike Galbraith
2008-02-21 17:32 ` [PATCH] Eliminate confusing "won't bisect on seeked tree" failure Carl Worth
2008-02-22 17:18 ` Junio C Hamano
2008-02-23 9:21 ` Karl Hasselström
2008-02-23 18:33 ` Carl Worth [this message]
2008-02-23 22:59 ` Junio C Hamano
2008-02-24 1:14 ` Carl Worth
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=87oda7o742.wl%cworth@cworth.org \
--to=cworth@cworth.org \
--cc=efault@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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).