return;
if (!state.nr_good && !state.nr_bad)
- bisect_log_printf(_("status: waiting for both %s and %s commits\n"),
+ bisect_log_printf(_("status: waiting for both '%s' and '%s' commits\n"),
terms->term_good, terms->term_bad);
else if (state.nr_good)
- bisect_log_printf(Q_("status: waiting for %s commit, %d %s commit known\n",
- "status: waiting for %s commit, %d %s commits known\n",
+ bisect_log_printf(Q_("status: waiting for '%s' commit, %d '%s' commit known\n",
+ "status: waiting for '%s' commit, %d '%s' commits known\n",
state.nr_good),
terms->term_bad, state.nr_good, terms->term_good);
else
- bisect_log_printf(_("status: waiting for %s commit(s), %s commit known\n"),
+ bisect_log_printf(_("status: waiting for '%s' commit(s), '%s' commit known\n"),
terms->term_good, terms->term_bad);
}
return error(_("no terms defined"));
if (!option) {
- printf(_("Your current terms are %s for the old state\n"
- "and %s for the new state.\n"),
+ printf(_("Your current terms are '%s' for the old state\n"
+ "and '%s' for the new state.\n"),
terms->term_good, terms->term_bad);
return 0;
}
strbuf_reset(&commit_name);
repo_format_commit_message(the_repository, commit, "%s",
&commit_name, &pp);
- fprintf(fp, "# possible first %s commit: [%s] %s\n",
+ fprintf(fp, "# possible first '%s' commit: [%s] %s\n",
terms->term_bad, oid_to_hex(&commit->object.oid),
commit_name.buf);
}
repo_format_commit_message(the_repository, commit, "%s", &commit_name,
&pp);
- res = append_to_file(git_path_bisect_log(), "# first %s commit: [%s] %s\n",
+ res = append_to_file(git_path_bisect_log(), "# first '%s' commit: [%s] %s\n",
terms->term_bad, oid_to_hex(&commit->object.oid),
commit_name.buf);
int rc = verify_good(terms, command.buf);
is_first_run = 0;
if (rc < 0 || 128 <= rc) {
- error(_("unable to verify %s on %s"
- " revision"), command.buf, terms->term_good);
+ error(_("unable to verify %s on '%s' revision"),
+ command.buf, terms->term_good);
res = BISECT_FAILED;
break;
}
if (rc == res) {
- error(_("bogus exit code %d for %s revision"),
+ error(_("bogus exit code %d for '%s' revision"),
rc, terms->term_good);
res = BISECT_FAILED;
break;
puts(_("bisect run success"));
res = BISECT_OK;
} else if (res == BISECT_INTERNAL_SUCCESS_1ST_BAD_FOUND) {
- printf(_("bisect found first %s commit\n"), terms->term_bad);
+ printf(_("bisect found first '%s' commit\n"), terms->term_bad);
res = BISECT_OK;
} else if (res) {
error(_("bisect run failed: 'git bisect %s'"
git bisect start $HASH4 $HASH1 &&
git bisect skip &&
git bisect bad > my_bisect_log.txt &&
- grep "$HASH2 is the first bad commit" my_bisect_log.txt
+ grep "$HASH2 is the first '\''bad'\'' commit" my_bisect_log.txt
'
# $HASH1 is good, $HASH4 is bad, we skip $HASH3 and $HASH2
git bisect start $HASH4 $HASH1 &&
git bisect skip &&
test_expect_code 2 git bisect skip >my_bisect_log.txt &&
- grep "first bad commit could be any of" my_bisect_log.txt &&
+ grep "first '\''bad'\'' commit could be any of" my_bisect_log.txt &&
! grep $HASH1 my_bisect_log.txt &&
grep $HASH2 my_bisect_log.txt &&
grep $HASH3 my_bisect_log.txt &&
git bisect start $HASH4 $HASH1 &&
git bisect skip &&
test_expect_code 2 git bisect good >my_bisect_log.txt &&
- grep "first bad commit could be any of" my_bisect_log.txt &&
+ grep "first '\''bad'\'' commit could be any of" my_bisect_log.txt &&
! grep $HASH1 my_bisect_log.txt &&
! grep $HASH2 my_bisect_log.txt &&
grep $HASH3 my_bisect_log.txt &&
git bisect good $HASH1 &&
git bisect skip &&
test_expect_code 2 git bisect good >my_bisect_log.txt &&
- grep "first bad commit could be any of" my_bisect_log.txt &&
+ grep "first '\''bad'\'' commit could be any of" my_bisect_log.txt &&
! grep $HASH1 my_bisect_log.txt &&
! grep $HASH2 my_bisect_log.txt &&
grep $HASH3 my_bisect_log.txt &&
test_bisect_run_args <<-'EOF_ARGS' 6<<-EOF_OUT 7<<-'EOF_ERR'
EOF_ARGS
running './run.sh'
- $HASH4 is the first bad commit
- bisect found first bad commit
+ $HASH4 is the first 'bad' commit
+ bisect found first 'bad' commit
EOF_OUT
EOF_ERR
"
<-->
EOF_ARGS
running './run.sh' '--'
- $HASH4 is the first bad commit
- bisect found first bad commit
+ $HASH4 is the first 'bad' commit
+ bisect found first 'bad' commit
EOF_OUT
EOF_ERR
"
<bar>
EOF_ARGS
running './run.sh' '--log' 'foo' '--no-log' 'bar'
- $HASH4 is the first bad commit
- bisect found first bad commit
+ $HASH4 is the first 'bad' commit
+ bisect found first 'bad' commit
EOF_OUT
EOF_ERR
"
<--bisect-start>
EOF_ARGS
running './run.sh' '--bisect-start'
- $HASH4 is the first bad commit
- bisect found first bad commit
+ $HASH4 is the first 'bad' commit
+ bisect found first 'bad' commit
EOF_OUT
EOF_ERR
"
fi
EOF
cat <<-'EOF' >expect &&
- unable to verify './fail.sh' on good revision
+ unable to verify './fail.sh' on 'good' revision
EOF
test_when_finished 'git bisect reset' &&
git bisect start &&
git bisect good $HASH1 &&
git bisect bad $HASH4 &&
git bisect run ./test_script.sh >my_bisect_log.txt &&
- grep "$HASH3 is the first bad commit" my_bisect_log.txt &&
+ grep "$HASH3 is the first '\''bad'\'' commit" my_bisect_log.txt &&
git bisect reset
'
EOF
git bisect start $HASH4 $HASH1 &&
git bisect run ./test_script.sh >my_bisect_log.txt &&
- grep "$HASH4 is the first bad commit" my_bisect_log.txt &&
+ grep "$HASH4 is the first '\''bad'\'' commit" my_bisect_log.txt &&
git bisect reset
'
git bisect good $HASH1 &&
git bisect bad $HASH4 &&
git bisect run ./test_script.sh >my_bisect_log.txt &&
- grep "$HASH3 is the first bad commit" my_bisect_log.txt
+ grep "$HASH3 is the first '\''bad'\'' commit" my_bisect_log.txt
'
test_expect_success POSIXPERM 'bisect run fails with non-executable test script' '
git bisect good $HASH1 &&
git bisect bad $HASH4 &&
test_must_fail git bisect run ./not-executable.sh >my_bisect_log.txt &&
- ! grep "is the first bad commit" my_bisect_log.txt
+ ! grep "is the first '\''bad'\'' commit" my_bisect_log.txt
'
test_expect_success 'bisect run accepts exit code 127 as bad' '
git bisect good $HASH1 &&
git bisect bad $HASH4 &&
git bisect run ./test_script.sh >my_bisect_log.txt &&
- grep "$HASH3 is the first bad commit" my_bisect_log.txt
+ grep "$HASH3 is the first '\''bad'\'' commit" my_bisect_log.txt
'
test_expect_success 'bisect run fails with missing test script' '
git bisect good $HASH1 &&
git bisect bad $HASH4 &&
test_must_fail git bisect run ./does-not-exist.sh >my_bisect_log.txt &&
- ! grep "is the first bad commit" my_bisect_log.txt
+ ! grep "is the first '\''bad'\'' commit" my_bisect_log.txt
'
# $HASH1 is good, $HASH5 is bad, we skip $HASH3
git bisect start $HASH5 $HASH1 &&
git bisect skip &&
git bisect good > my_bisect_log.txt &&
- grep "$HASH5 is the first bad commit" my_bisect_log.txt &&
+ grep "$HASH5 is the first '\''bad'\'' commit" my_bisect_log.txt &&
git bisect log > log_to_replay.txt &&
git bisect reset
'
test_expect_success 'bisect skip and bisect replay' '
git bisect replay log_to_replay.txt > my_bisect_log.txt &&
- grep "$HASH5 is the first bad commit" my_bisect_log.txt &&
+ grep "$HASH5 is the first '\''bad'\'' commit" my_bisect_log.txt &&
git bisect reset
'
EOF
git bisect start $HASH6 $HASH1 &&
test_expect_code 2 git bisect run ./test_script.sh >my_bisect_log.txt &&
- grep "first bad commit could be any of" my_bisect_log.txt &&
+ grep "first '\''bad'\'' commit could be any of" my_bisect_log.txt &&
! grep $HASH3 my_bisect_log.txt &&
! grep $HASH6 my_bisect_log.txt &&
grep $HASH4 my_bisect_log.txt &&
EOF
git bisect start $HASH7 $HASH1 &&
git bisect run ./test_script.sh >my_bisect_log.txt &&
- grep "$HASH6 is the first bad commit" my_bisect_log.txt
+ grep "$HASH6 is the first '\''bad'\'' commit" my_bisect_log.txt
'
test_expect_success 'bisect skip only one range' '
git bisect skip $HASH1..$HASH5 &&
test "$HASH6" = "$(git rev-parse --verify HEAD)" &&
test_must_fail git bisect bad > my_bisect_log.txt &&
- grep "first bad commit could be any of" my_bisect_log.txt
+ grep "first '\''bad'\'' commit could be any of" my_bisect_log.txt
'
test_expect_success 'bisect skip many ranges' '
git bisect skip $HASH2 $HASH2.. ..$HASH5 &&
test "$HASH6" = "$(git rev-parse --verify HEAD)" &&
test_must_fail git bisect bad > my_bisect_log.txt &&
- grep "first bad commit could be any of" my_bisect_log.txt
+ grep "first '\''bad'\'' commit could be any of" my_bisect_log.txt
'
test_expect_success 'bisect starting with a detached HEAD' '
test_expect_success 'bisect errors out if bad and good are mistaken' '
git bisect reset &&
test_must_fail git bisect start $HASH2 $HASH4 2> rev_list_error &&
- test_grep "mistook good and bad" rev_list_error &&
+ test_grep "mistook '\''good'\'' and '\''bad'\''" rev_list_error &&
git bisect reset
'
rev_hash6=$(git rev-parse --verify HEAD) &&
test "$rev_hash6" = "$HASH6" &&
git bisect good > my_bisect_log.txt &&
- grep "$HASH7 is the first bad commit" my_bisect_log.txt &&
+ grep "$HASH7 is the first '\''bad'\'' commit" my_bisect_log.txt &&
git bisect reset &&
rev_hash6=$(git rev-parse --verify bisect) &&
test "$rev_hash6" = "$HASH6" &&
git bisect good $HASH4 &&
git bisect bad $B_HASH &&
git bisect run ./test_script.sh >my_bisect_log.txt &&
- grep "$B_HASH is the first bad commit" my_bisect_log.txt &&
+ grep "$B_HASH is the first '\''bad'\'' commit" my_bisect_log.txt &&
git bisect reset &&
test_path_is_missing .git/BISECT_FIRST_PARENT
'
para1=$(git rev-parse --verify HEAD) &&
test "$para1" = "$PARA_HASH1" &&
git bisect bad > my_bisect_log.txt &&
- grep "$PARA_HASH1 is the first bad commit" my_bisect_log.txt
+ grep "$PARA_HASH1 is the first '\''bad'\'' commit" my_bisect_log.txt
'
test_expect_success 'restricting bisection on one dir and a file' '
para1=$(git rev-parse --verify HEAD) &&
test "$para1" = "$PARA_HASH1" &&
git bisect good > my_bisect_log.txt &&
- grep "$PARA_HASH4 is the first bad commit" my_bisect_log.txt
+ grep "$PARA_HASH4 is the first '\''bad'\'' commit" my_bisect_log.txt
'
test_expect_success 'skipping away from skipped commit' '
"test \$(git rev-list BISECT_HEAD ^$HASH2 --max-count=1 | wc -l) = 0" \
>../nocheckout.log
) &&
- grep "$HASH3 is the first bad commit" nocheckout.log
+ grep "$HASH3 is the first '\''bad'\'' commit" nocheckout.log
'
"test \$(git rev-list BISECT_HEAD ^$HASH2 --max-count=1 | wc -l) = 0" \
>../defaulted.log
) &&
- grep "$HASH3 is the first bad commit" defaulted.log
+ grep "$HASH3 is the first '\''bad'\'' commit" defaulted.log
'
#
git bisect start '$HASH4' '$HASH2'
# good: [$HASH3] Add <3: Another new day for git> into <hello>.
git bisect good $HASH3
-# first bad commit: [$HASH4] Add <4: Ciao for now> into <hello>.
+# first 'bad' commit: [$HASH4] Add <4: Ciao for now> into <hello>.
EOF
test_expect_success 'bisect log: successful result' '
# skip: [$HASH3] Add <3: Another new day for git> into <hello>.
git bisect skip $HASH3
# only skipped commits left to test
-# possible first bad commit: [$HASH4] Add <4: Ciao for now> into <hello>.
-# possible first bad commit: [$HASH3] Add <3: Another new day for git> into <hello>.
+# possible first 'bad' commit: [$HASH4] Add <4: Ciao for now> into <hello>.
+# possible first 'bad' commit: [$HASH3] Add <3: Another new day for git> into <hello>.
EOF
test_expect_success 'bisect log: only skip commits left' '
git bisect new $HASH4 &&
git bisect new &&
git bisect new >bisect_result &&
- grep "$HASH2 is the first new commit" bisect_result &&
+ grep "$HASH2 is the first '\''new'\'' commit" bisect_result &&
git bisect log >log_to_replay.txt &&
git bisect reset
'
test_expect_success 'bisect replay with old and new' '
git bisect replay log_to_replay.txt >bisect_result &&
- grep "$HASH2 is the first new commit" bisect_result &&
+ grep "$HASH2 is the first '\''new'\'' commit" bisect_result &&
git bisect reset
'
test_expect_success 'bisect replay with CRLF log' '
append_cr <log_to_replay.txt >log_to_replay_crlf.txt &&
git bisect replay log_to_replay_crlf.txt >bisect_result_crlf &&
- grep "$HASH2 is the first new commit" bisect_result_crlf &&
+ grep "$HASH2 is the first '\''new'\'' commit" bisect_result_crlf &&
git bisect reset
'
test_expect_success 'bisect start with one term1 and term2' '
git bisect reset &&
git bisect start --term-old term2 --term-new term1 >bisect_result &&
- grep "status: waiting for both term2 and term1 commits" bisect_result &&
+ test_grep "status: waiting for both '\''term2'\'' and '\''term1'\'' commits" bisect_result &&
git bisect term2 $HASH1 >bisect_result &&
- grep "status: waiting for term1 commit, 1 term2 commit known" bisect_result &&
+ test_grep "status: waiting for '\''term1'\'' commit, 1 '\''term2'\'' commit known" bisect_result &&
git bisect term1 $HASH4 &&
git bisect term1 &&
git bisect term1 >bisect_result &&
- grep "$HASH2 is the first term1 commit" bisect_result &&
+ test_grep "$HASH2 is the first '\''term1'\'' commit" bisect_result &&
git bisect log >log_to_replay.txt &&
git bisect reset
'
test_expect_success 'bisect replay with term1 and term2' '
git bisect replay log_to_replay.txt >bisect_result &&
- grep "$HASH2 is the first term1 commit" bisect_result &&
+ grep "$HASH2 is the first '\''term1'\'' commit" bisect_result &&
git bisect reset
'
git bisect start --term-new term1 --term-old term2 $HASH4 $HASH1 &&
git bisect term1 &&
git bisect run false >bisect_result &&
- grep "bisect found first term1 commit" bisect_result &&
+ test_grep "bisect found first '\''term1'\'' commit" bisect_result &&
git bisect log >log_to_replay.txt &&
git bisect reset
'
git bisect start --term-new term1 --term-old term2 $HASH4 $HASH1 &&
git bisect term1 &&
git bisect term1 >bisect_result &&
- grep "$HASH2 is the first term1 commit" bisect_result &&
+ grep "$HASH2 is the first '\''term1'\'' commit" bisect_result &&
git bisect log >log_to_replay.txt &&
git bisect reset
'
git bisect start --term-bad=one --term-good=two &&
git bisect terms >actual &&
cat <<-EOF >expected &&
- Your current terms are two for the old state
- and one for the new state.
+ Your current terms are '\''two'\'' for the old state
+ and '\''one'\'' for the new state.
EOF
test_cmp expected actual &&
git bisect terms --term-bad >actual &&
git bisect good tag-one &&
git bisect bad tag-two >output &&
bad=$(git rev-parse --verify tag-two^{commit}) &&
- grep "$bad is the first bad commit" output
+ grep "$bad is the first '\''bad'\'' commit" output
'
test_expect_success 'bisect run fails with exit code equals or greater than 128' '
test_expect_success 'bisect state output with multiple good commits' '
git bisect reset &&
git bisect start >output &&
- grep "waiting for both good and bad commits" output &&
+ grep "waiting for both '\''good'\'' and '\''bad'\'' commits" output &&
git bisect log >output &&
- grep "waiting for both good and bad commits" output &&
+ grep "waiting for both '\''good'\'' and '\''bad'\'' commits" output &&
git bisect good "$HASH1" >output &&
- grep "waiting for bad commit, 1 good commit known" output &&
+ grep "waiting for '\''bad'\'' commit, 1 '\''good'\'' commit known" output &&
git bisect log >output &&
- grep "waiting for bad commit, 1 good commit known" output &&
+ grep "waiting for '\''bad'\'' commit, 1 '\''good'\'' commit known" output &&
git bisect good "$HASH2" >output &&
- grep "waiting for bad commit, 2 good commits known" output &&
+ grep "waiting for '\''bad'\'' commit, 2 '\''good'\'' commits known" output &&
git bisect log >output &&
- grep "waiting for bad commit, 2 good commits known" output
+ grep "waiting for '\''bad'\'' commit, 2 '\''good'\'' commits known" output
'
test_expect_success 'bisect state output with bad commit' '
git bisect reset &&
git bisect start >output &&
- grep "waiting for both good and bad commits" output &&
+ grep "waiting for both '\''good'\'' and '\''bad'\'' commits" output &&
git bisect log >output &&
- grep "waiting for both good and bad commits" output &&
+ grep "waiting for both '\''good'\'' and '\''bad'\'' commits" output &&
git bisect bad "$HASH4" >output &&
- grep -F "waiting for good commit(s), bad commit known" output &&
+ grep -F "waiting for '\''good'\'' commit(s), '\''bad'\'' commit known" output &&
git bisect log >output &&
- grep -F "waiting for good commit(s), bad commit known" output
+ grep -F "waiting for '\''good'\'' commit(s), '\''bad'\'' commit known" output
'
test_expect_success 'verify correct error message' '