From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carl Worth Subject: Re: [PATCH] Eliminate confusing "won't bisect on seeked tree" failure Date: Sat, 23 Feb 2008 10:33:33 -0800 Message-ID: <87oda7o742.wl%cworth@cworth.org> References: <1203571214.24456.6.camel@homer.simson.net> <87pruqfc59.wl%cworth@cworth.org> <7v63wgap10.fsf@gitster.siamese.dyndns.org> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/signed; boundary="pgp-sign-Multipart_Sat_Feb_23_10:33:27_2008-1"; micalg=pgp-sha1; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit Cc: Mike Galbraith , git To: Junio C Hamano X-From: git-owner@vger.kernel.org Sat Feb 23 19:34:26 2008 Return-path: Envelope-to: gcvg-git-2@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by lo.gmane.org with esmtp (Exim 4.50) id 1JSzCZ-0001iZ-45 for gcvg-git-2@gmane.org; Sat, 23 Feb 2008 19:34:23 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756982AbYBWSdr (ORCPT ); Sat, 23 Feb 2008 13:33:47 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756040AbYBWSdr (ORCPT ); Sat, 23 Feb 2008 13:33:47 -0500 Received: from olra.theworths.org ([82.165.184.25]:53863 "EHLO olra.theworths.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756912AbYBWSdq (ORCPT ); Sat, 23 Feb 2008 13:33:46 -0500 Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id A434245496A; Sat, 23 Feb 2008 10:33:45 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AG5LNNYu8ibu; Sat, 23 Feb 2008 10:33:44 -0800 (PST) Received: from raht.cworth.org (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id C6AF1431FDF; Sat, 23 Feb 2008 10:33:43 -0800 (PST) In-Reply-To: <7v63wgap10.fsf@gitster.siamese.dyndns.org> User-Agent: Wanderlust/2.14.0 (Africa) Emacs/21.4 Mule/5.0 (SAKAKI) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: --pgp-sign-Multipart_Sat_Feb_23_10:33:27_2008-1 Content-Type: text/plain; charset=US-ASCII 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 --- 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 --pgp-sign-Multipart_Sat_Feb_23_10:33:27_2008-1 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQBHwGb96JDdNq8qSWgRAupIAJ9qvlG5v3Msl4ZZqNqDtNlPQ6f9MQCeIkwf 1t7pEZL2kEH8H75v+2I6pgI= =ViOz -----END PGP SIGNATURE----- --pgp-sign-Multipart_Sat_Feb_23_10:33:27_2008-1--