summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-11-17 15:00:03 -0800
committerJunio C Hamano <gitster@pobox.com>2010-11-17 15:00:03 -0800
commit10793e6957d3400641a908236e93c09d2a1d81c4 (patch)
tree6f764a2bb3f9a1b3a707274b64aa17bb895c0fd9
parent734e0ba43767ebb73bb35a921c0a38e956f0b4d1 (diff)
parent2c7c3877def8629278f5367a461ef269b0cfaa99 (diff)
downloadgit-10793e6957d3400641a908236e93c09d2a1d81c4.tar.gz
Merge branch 'sg/bisect'
* sg/bisect: bisect: check for mandatory argument of 'bisect replay' bisect: improve error msg of 'bisect reset' when original HEAD is deleted bisect: improve error message of 'bisect log' while not bisecting
-rwxr-xr-xgit-bisect.sh14
1 files changed, 12 insertions, 2 deletions
diff --git a/git-bisect.sh b/git-bisect.sh
index 6e2acb8ef2..c21e33c8d1 100755
--- a/git-bisect.sh
+++ b/git-bisect.sh
@@ -316,7 +316,12 @@ bisect_reset() {
*)
usage ;;
esac
- git checkout "$branch" -- && bisect_clean_state
+ if git checkout "$branch" -- ; then
+ bisect_clean_state
+ else
+ die "Could not check out original HEAD '$branch'." \
+ "Try 'git bisect reset <commit>'."
+ fi
}
bisect_clean_state() {
@@ -338,6 +343,7 @@ bisect_clean_state() {
}
bisect_replay () {
+ test "$#" -eq 1 || die "No logfile given"
test -r "$1" || die "cannot read $1 for replaying"
bisect_reset
while read git bisect command rev
@@ -412,6 +418,10 @@ bisect_run () {
done
}
+bisect_log () {
+ test -s "$GIT_DIR/BISECT_LOG" || die "We are not bisecting."
+ cat "$GIT_DIR/BISECT_LOG"
+}
case "$#" in
0)
@@ -438,7 +448,7 @@ case "$#" in
replay)
bisect_replay "$@" ;;
log)
- cat "$GIT_DIR/BISECT_LOG" ;;
+ bisect_log ;;
run)
bisect_run "$@" ;;
*)