{"thread":{"id":"5934","subject":"[PATCH] bisect reset: Leave the tree in usable state if git-checkout failed","startedAt":"2006-10-16T00:59:25Z","lastAt":"2006-10-16T01:02:32Z","messageCount":2,"participants":["Petr Baudis"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"28822","messageId":"20061016005925.27019.38262.stgit@machine.or.cz","threadId":"5934","inReplyTo":null,"subject":"[PATCH] bisect reset: Leave the tree in usable state if git-checkout failed","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2006-10-16T00:59:25Z","receivedAt":"2006-10-16T00:59:25Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"I had local modifications in the tree and doing bisect reset required me to\nmanually edit .git/HEAD.\n\nSigned-off-by: Petr Baudis <pasky@suse.cz>\n---\n\n git-bisect.sh |   11 ++++++-----\n 1 files changed, 6 insertions(+), 5 deletions(-)\n\ndiff --git a/git-bisect.sh b/git-bisect.sh\nindex 06a8d26..09cd179 100755\n--- a/git-bisect.sh\n+++ b/git-bisect.sh\n@@ -179,11 +179,12 @@ bisect_reset() {\n         *)\n \t    usage ;;\n \tesac\n-\tgit checkout \"$branch\" &&\n-\trm -fr \"$GIT_DIR/refs/bisect\"\n-\trm -f \"$GIT_DIR/refs/heads/bisect\" \"$GIT_DIR/head-name\"\n-\trm -f \"$GIT_DIR/BISECT_LOG\"\n-\trm -f \"$GIT_DIR/BISECT_NAMES\"\n+\tif ! git checkout \"$branch\"; then\n+\t\trm -fr \"$GIT_DIR/refs/bisect\"\n+\t\trm -f \"$GIT_DIR/refs/heads/bisect\" \"$GIT_DIR/head-name\"\n+\t\trm -f \"$GIT_DIR/BISECT_LOG\"\n+\t\trm -f \"$GIT_DIR/BISECT_NAMES\"\n+\tfi\n }\n \n bisect_replay () {\n"},{"id":"28824","messageId":"20061016010232.GX20017@pasky.or.cz","threadId":"5934","inReplyTo":"20061016005925.27019.38262.stgit@machine.or.cz","subject":"Re: [PATCH] bisect reset: Leave the tree in usable state if git-checkout failed","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2006-10-16T01:02:32Z","receivedAt":"2006-10-16T01:02:32Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Mon, Oct 16, 2006 at 02:59:25AM CEST, I got a letter\nwhere Petr Baudis <pasky@suse.cz> said that...\n> I had local modifications in the tree and doing bisect reset required me to\n> manually edit .git/HEAD.\n> \n> Signed-off-by: Petr Baudis <pasky@suse.cz>\n> ---\n> \n>  git-bisect.sh |   11 ++++++-----\n>  1 files changed, 6 insertions(+), 5 deletions(-)\n> \n> diff --git a/git-bisect.sh b/git-bisect.sh\n> index 06a8d26..09cd179 100755\n> --- a/git-bisect.sh\n> +++ b/git-bisect.sh\n> @@ -179,11 +179,12 @@ bisect_reset() {\n>          *)\n>  \t    usage ;;\n>  \tesac\n> -\tgit checkout \"$branch\" &&\n> -\trm -fr \"$GIT_DIR/refs/bisect\"\n> -\trm -f \"$GIT_DIR/refs/heads/bisect\" \"$GIT_DIR/head-name\"\n> -\trm -f \"$GIT_DIR/BISECT_LOG\"\n> -\trm -f \"$GIT_DIR/BISECT_NAMES\"\n> +\tif ! git checkout \"$branch\"; then\n\nDoh, please drop the !. I had it that way before and added the negation\nmark as a last-minute \"fix\". :/ Sorry. Not being too good at doing\nrandom shell fixes in the middle of C coding.\n\n> +\t\trm -fr \"$GIT_DIR/refs/bisect\"\n> +\t\trm -f \"$GIT_DIR/refs/heads/bisect\" \"$GIT_DIR/head-name\"\n> +\t\trm -f \"$GIT_DIR/BISECT_LOG\"\n> +\t\trm -f \"$GIT_DIR/BISECT_NAMES\"\n> +\tfi\n>  }\n>  \n>  bisect_replay () {\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\n#!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj\n$/=unpack('H*',$_);$_=`echo 16dio\\U$k\"SK$/SM$n\\EsN0p[lN*1\nlK[d2%Sa2/d0$^Ixp\"|dc`;s/\\W//g;$_=pack('H*',/((..)*)$/)\n"}]}