summaryrefslogtreecommitdiff
path: root/git-bisect.sh
diff options
context:
space:
mode:
authorPranit Bauva <pranit.bauva@gmail.com>2020-10-15 13:38:32 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-10-16 19:24:20 (GMT)
commit88ad372fc02c119a4e44ae71c93b6fab9d998512 (patch)
tree88e3046d14266c748b80d505ae2473909c129c63 /git-bisect.sh
parent517ecb3161daa4503f7638489fd44177b3659913 (diff)
downloadgit-88ad372fc02c119a4e44ae71c93b6fab9d998512.zip
git-88ad372fc02c119a4e44ae71c93b6fab9d998512.tar.gz
git-88ad372fc02c119a4e44ae71c93b6fab9d998512.tar.bz2
bisect--helper: finish porting `bisect_start()` to C
Add the subcommand to `git bisect--helper` and call it from git-bisect.sh. With the conversion of `bisect_auto_next()` from shell to C in a previous commit, `bisect_start()` can now be fully ported to C. So let's complete the `--bisect-start` subcommand of `git bisect--helper` so that it fully implements `bisect_start()`, and let's use this subcommand in `git-bisect.sh` instead of `bisect_start()`. Note that the `eval` in the changed line of `git-bisect.sh` cannot be dropped: it is necessary because the `rev` and the `tail` variables may contain multiple, quoted arguments that need to be passed to `bisect--helper` (without the quotes, naturally). Mentored-by: Christian Couder <chriscool@tuxfamily.org> Mentored-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Pranit Bauva <pranit.bauva@gmail.com> Signed-off-by: Tanushree Tumane <tanushreetumane@gmail.com> Signed-off-by: Miriam Rubio <mirucam@gmail.com> Reviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-bisect.sh')
-rwxr-xr-xgit-bisect.sh26
1 files changed, 2 insertions, 24 deletions
diff --git a/git-bisect.sh b/git-bisect.sh
index f7f39c7..fd4342c 100755
--- a/git-bisect.sh
+++ b/git-bisect.sh
@@ -49,27 +49,6 @@ bisect_head()
fi
}
-bisect_start() {
- git bisect--helper --bisect-start $@ || exit
-
- #
- # Change state.
- # In case of mistaken revs or checkout error, or signals received,
- # "bisect_auto_next" below may exit or misbehave.
- # We have to trap this to be able to clean up using
- # "bisect_clean_state".
- #
- trap 'git bisect--helper --bisect-clean-state' 0
- trap 'exit 255' 1 2 3 15
-
- #
- # Check if we can proceed to the next bisect state.
- #
- git bisect--helper --bisect-auto-next || exit
-
- trap '-' 0
-}
-
bisect_skip() {
all=''
for arg in "$@"
@@ -163,8 +142,7 @@ bisect_replay () {
get_terms
case "$command" in
start)
- cmd="bisect_start $rev $tail"
- eval "$cmd" ;;
+ eval "git bisect--helper --bisect-start $rev $tail" ;;
"$TERM_GOOD"|"$TERM_BAD"|skip)
git bisect--helper --bisect-write "$command" "$rev" "$TERM_GOOD" "$TERM_BAD" || exit;;
terms)
@@ -264,7 +242,7 @@ case "$#" in
help)
git bisect -h ;;
start)
- bisect_start "$@" ;;
+ git bisect--helper --bisect-start "$@" ;;
bad|good|new|old|"$TERM_BAD"|"$TERM_GOOD")
bisect_state "$cmd" "$@" ;;
skip)