Junio C Hamano <gitster@xxxxxxxxx> writes: > The second sentence may want to be something like > > If you mistyped one of the terms, you can do another "git > bisect terms <term-new> <term-old>" to correct them, but > that is possible only before you start the bisection. Applied, thanks. I currently have this in addition to v9 in my branch. I'll resend later (https://github.com/moy/git/tree/bisect-terms is up to date). diff --git a/Documentation/git-bisect.txt b/Documentation/git-bisect.txt index e783f87..7609cd6 100644 --- a/Documentation/git-bisect.txt +++ b/Documentation/git-bisect.txt @@ -143,19 +143,19 @@ set your own terms. git bisect terms <term-new> <term-old> ------------------------------------------------ -This command has to be used before a bisection has started. <term-old> -must be associated with the latest revisions and <term-new> with the -ancestors of <term-old>. For example, if something was buggy in the +This command has to be used before a bisection has started. <term-new> +must be associated with the latest revisions and <term-old> with some +ancestors of <term-new>. For example, if something was buggy in the old part of the history, you know somewhere the bug was fixed, and you want to find the exact commit that fixed it, you may want to say `git -bisect terms fixed broken`; this way, you would mark a commit that +bisect terms broken fixed`; this way, you would mark a commit that still has the bug with `broken`, and a newer one after the fix with `fixed`. -Only the first bisection following the `git bisect terms` will use the +Only the bisection following the `git bisect terms` will use the terms. If you mistyped one of the terms you can do again `git bisect -terms <term-old> <term-new>`. - +terms <term-new> <term-old>`, but that is possible only before you +start the bisection. Bisect visualize ~~~~~~~~~~~~~~~~ diff --git a/git-bisect.sh b/git-bisect.sh index 8fee712..07c64d9 100755 --- a/git-bisect.sh +++ b/git-bisect.sh @@ -549,6 +549,20 @@ get_terms () { fi } +write_terms () { + NAME_BAD=$1 + NAME_GOOD=$2 + check_term_format "$NAME_BAD" + check_term_format "$NAME_GOOD" + printf '%s\n%s\n' "$NAME_BAD" "$NAME_GOOD" >"$GIT_DIR/BISECT_TERMS" +} + +check_term_format () { + term=$1 + git check-ref-format refs/bisect/"$term" || + die "$(eval_gettext "'\$term' is not a valid term")" +} + check_and_set_terms () { cmd="$1" case "$cmd" in @@ -579,8 +593,8 @@ check_and_set_terms () { bisect_voc () { case "$1" in - bad) echo "bad|old" ;; - good) echo "good|new" ;; + bad) echo "bad|new" ;; + good) echo "good|old" ;; esac } @@ -611,20 +625,6 @@ Otherwise, to start a new bisection with new terms, please use esac } -write_terms () { - NAME_BAD=$1 - NAME_GOOD=$2 - check_term_format "$NAME_BAD" - check_term_format "$NAME_GOOD" - printf '%s\n%s\n' "$NAME_BAD" "$NAME_GOOD" >"$GIT_DIR/BISECT_TERMS" -} - -check_term_format () { - term=$1 - git check-ref-format refs/bisect/"$term" || - die "$(eval_gettext "'\$term' is not a valid term")" -} - case "$#" in 0) usage ;; -- Matthieu Moy http://www-verimag.imag.fr/~moy/ -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html