All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bisect reset: Allow resetting to any commit, not just a branch
@ 2009-10-12 16:38 Anders Kaseorg
  2009-10-12 21:06 ` Junio C Hamano
  0 siblings, 1 reply; 18+ messages in thread
From: Anders Kaseorg @ 2009-10-12 16:38 UTC (permalink / raw)
  To: gister; +Cc: git

‘git bisect reset’ could already checkout an arbitrary commit if you
were on a detached HEAD before starting the bisection.  This lets you
specify an arbitrary commit to ‘git bisect reset <commit>’.

This also provides a way to clean the bisection state without moving
HEAD: ‘git bisect reset HEAD’.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
---
 git-bisect.sh |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/git-bisect.sh b/git-bisect.sh
index 6f6f039..d319b9f 100755
--- a/git-bisect.sh
+++ b/git-bisect.sh
@@ -311,8 +311,7 @@ bisect_reset() {
 	}
 	case "$#" in
 	0) branch=$(cat "$GIT_DIR/BISECT_START") ;;
-	1) git show-ref --verify --quiet -- "refs/heads/$1" ||
-	       die "$1 does not seem to be a valid branch"
+	1) git rev-parse --verify "$1^{commit}" || exit
 	   branch="$1" ;;
 	*)
 	    usage ;;
-- 
1.6.5

^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2009-10-14  9:14 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-12 16:38 [PATCH] bisect reset: Allow resetting to any commit, not just a branch Anders Kaseorg
2009-10-12 21:06 ` Junio C Hamano
2009-10-12 21:31   ` Anders Kaseorg
2009-10-12 23:41     ` Junio C Hamano
2009-10-13  6:45       ` Johannes Sixt
2009-10-13  7:21         ` Junio C Hamano
2009-10-13  7:03       ` Anders Kaseorg
2009-10-13 15:22       ` [PATCH v2] " Anders Kaseorg
2009-10-13 20:06         ` Christian Couder
2009-10-13 20:09           ` Anders Kaseorg
2009-10-13 20:30             ` Christian Couder
2009-10-13 21:02           ` [PATCH v3] " Anders Kaseorg
2009-10-14  9:13             ` Junio C Hamano
2009-10-13  6:39   ` [PATCH] " Johannes Sixt
2009-10-13  7:01     ` Junio C Hamano
2009-10-13  7:45       ` Johannes Sixt
2009-10-13  8:33         ` Junio C Hamano
2009-10-13 14:29           ` Anders Kaseorg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.