bisect: print bisect terms in single quotes
As bisect terms can be arbitrarily chosen, they have been quoted in some status messages, and in even more by translators. To make the role of bisect terms more clear, including in translations, and for consistency, 'enquote' all occurrences of bisect terms in status messages. Signed-off-by: Jonas Rebmann <kernel@schlaraffenlan.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jonas Rebmann committed
May 14, 2026 at 11:07 UTC
0c0f93e7fa645c1058226a9bfde9e2b4441edf96
3 files changed
+77
-77
bisect.c
+8
-8
@@ -711,7 +711,7 @@ static enum bisect_error error_if_skipped_commits(struct commit_list *tried,
711
return BISECT_OK;
712
713
printf("There are only 'skip'ped commits left to test.\n"
714
- "The first %s commit could be any of:\n", term_bad);
714
+ "The first '%s' commit could be any of:\n", term_bad);
715
716
for ( ; tried; tried = tried->next)
717
printf("%s\n", oid_to_hex(&tried->item->object.oid));
@@ -810,7 +810,7 @@ static enum bisect_error handle_bad_merge_base(void)
810
"between %s and [%s].\n"),
811
bad_hex, bad_hex, good_hex);
812
} else {
813
- fprintf(stderr, _("The merge base %s is %s.\n"
813
+ fprintf(stderr, _("The merge base %s is '%s'.\n"
814
"This means the first '%s' commit is "
815
"between %s and [%s].\n"),
816
bad_hex, term_bad, term_good, bad_hex, good_hex);
@@ -820,9 +820,9 @@ static enum bisect_error handle_bad_merge_base(void)
820
return BISECT_MERGE_BASE_CHECK;
821
}
822
823
- fprintf(stderr, _("Some %s revs are not ancestors of the %s rev.\n"
823
+ fprintf(stderr, _("Some '%s' revs are not ancestors of the '%s' rev.\n"
824
"git bisect cannot work properly in this case.\n"
825
- "Maybe you mistook %s and %s revs?\n"),
825
+ "Maybe you mistook '%s' and '%s' revs?\n"),
826
term_good, term_bad, term_good, term_bad);
827
return BISECT_FAILED;
828
}
@@ -835,7 +835,7 @@ static void handle_skipped_merge_base(const struct object_id *mb)
835
836
warning(_("the merge base between %s and [%s] "
837
"must be skipped.\n"
838
- "So we cannot be sure the first %s commit is "
838
+ "So we cannot be sure the first '%s' commit is "
839
"between %s and %s.\n"
840
"We continue anyway."),
841
bad_hex, good_hex, term_bad, mb_hex, bad_hex);
@@ -928,7 +928,7 @@ static enum bisect_error check_good_are_ancestors_of_bad(struct repository *r,
928
struct commit **rev;
929
930
if (!current_bad_oid)
931
- return error(_("a %s revision is needed"), term_bad);
931
+ return error(_("a '%s' revision is needed"), term_bad);
932
933
filename = repo_git_path(the_repository, "BISECT_ANCESTORS_OK");
934
@@ -1090,7 +1090,7 @@ enum bisect_error bisect_next_all(struct repository *r, const char *prefix)
1090
res = error_if_skipped_commits(tried, NULL);
1091
if (res < 0)
1092
goto cleanup;
1093
- printf(_("%s was both %s and %s\n"),
1093
+ printf(_("%s was both '%s' and '%s'\n"),
1094
oid_to_hex(current_bad_oid),
1095
term_good,
1096
term_bad);
@@ -1113,7 +1113,7 @@ enum bisect_error bisect_next_all(struct repository *r, const char *prefix)
1113
res = error_if_skipped_commits(tried, current_bad_oid);
1114
if (res)
1115
goto cleanup;
1116
- printf("%s is the first %s commit\n", oid_to_hex(bisect_rev),
1116
+ printf("%s is the first '%s' commit\n", oid_to_hex(bisect_rev),
1117
term_bad);
1118
1119
show_commit(revs.commits->item);
builtin/bisect.c
+12
-12
@@ -465,15 +465,15 @@ static void bisect_print_status(const struct bisect_terms *terms)
465
return;
466
467
if (!state.nr_good && !state.nr_bad)
468
- bisect_log_printf(_("status: waiting for both %s and %s commits\n"),
468
+ bisect_log_printf(_("status: waiting for both '%s' and '%s' commits\n"),
469
terms->term_good, terms->term_bad);
470
else if (state.nr_good)
471
- bisect_log_printf(Q_("status: waiting for %s commit, %d %s commit known\n",
472
- "status: waiting for %s commit, %d %s commits known\n",
471
+ bisect_log_printf(Q_("status: waiting for '%s' commit, %d '%s' commit known\n",
472
+ "status: waiting for '%s' commit, %d '%s' commits known\n",
473
state.nr_good),
474
terms->term_bad, state.nr_good, terms->term_good);
475
else
476
- bisect_log_printf(_("status: waiting for %s commit(s), %s commit known\n"),
476
+ bisect_log_printf(_("status: waiting for '%s' commit(s), '%s' commit known\n"),
477
terms->term_good, terms->term_bad);
478
}
479
@@ -516,8 +516,8 @@ static int bisect_terms(struct bisect_terms *terms, const char *option)
516
return error(_("no terms defined"));
517
518
if (!option) {
519
- printf(_("Your current terms are %s for the old state\n"
520
- "and %s for the new state.\n"),
519
+ printf(_("Your current terms are '%s' for the old state\n"
520
+ "and '%s' for the new state.\n"),
521
terms->term_good, terms->term_bad);
522
return 0;
523
}
@@ -635,7 +635,7 @@ static int bisect_skipped_commits(struct bisect_terms *terms)
635
strbuf_reset(&commit_name);
636
repo_format_commit_message(the_repository, commit, "%s",
637
&commit_name, &pp);
638
- fprintf(fp, "# possible first %s commit: [%s] %s\n",
638
+ fprintf(fp, "# possible first '%s' commit: [%s] %s\n",
639
terms->term_bad, oid_to_hex(&commit->object.oid),
640
commit_name.buf);
641
}
@@ -666,7 +666,7 @@ static int bisect_successful(struct bisect_terms *terms)
666
repo_format_commit_message(the_repository, commit, "%s", &commit_name,
667
&pp);
668
669
- res = append_to_file(git_path_bisect_log(), "# first %s commit: [%s] %s\n",
669
+ res = append_to_file(git_path_bisect_log(), "# first '%s' commit: [%s] %s\n",
670
terms->term_bad, oid_to_hex(&commit->object.oid),
671
commit_name.buf);
672
@@ -1265,13 +1265,13 @@ static int bisect_run(struct bisect_terms *terms, int argc, const char **argv)
1265
int rc = verify_good(terms, command.buf);
1266
is_first_run = 0;
1267
if (rc < 0 || 128 <= rc) {
1268
- error(_("unable to verify %s on %s"
1269
- " revision"), command.buf, terms->term_good);
1268
+ error(_("unable to verify %s on '%s' revision"),
1269
+ command.buf, terms->term_good);
1270
res = BISECT_FAILED;
1271
break;
1272
}
1273
if (rc == res) {
1274
- error(_("bogus exit code %d for %s revision"),
1274
+ error(_("bogus exit code %d for '%s' revision"),
1275
rc, terms->term_good);
1276
res = BISECT_FAILED;
1277
break;
@@ -1317,7 +1317,7 @@ static int bisect_run(struct bisect_terms *terms, int argc, const char **argv)
1317
puts(_("bisect run success"));
1318
res = BISECT_OK;
1319
} else if (res == BISECT_INTERNAL_SUCCESS_1ST_BAD_FOUND) {
1320
- printf(_("bisect found first %s commit\n"), terms->term_bad);
1320
+ printf(_("bisect found first '%s' commit\n"), terms->term_bad);
1321
res = BISECT_OK;
1322
} else if (res) {
1323
error(_("bisect run failed: 'git bisect %s'"
t/t6030-bisect-porcelain.sh
+57
-57
@@ -258,7 +258,7 @@ test_expect_success 'bisect skip: successful result' '
258
git bisect start $HASH4 $HASH1 &&
259
git bisect skip &&
260
git bisect bad > my_bisect_log.txt &&
261
- grep "$HASH2 is the first bad commit" my_bisect_log.txt
261
+ grep "$HASH2 is the first '\''bad'\'' commit" my_bisect_log.txt
262
'
263
264
# $HASH1 is good, $HASH4 is bad, we skip $HASH3 and $HASH2
@@ -269,7 +269,7 @@ test_expect_success 'bisect skip: cannot tell between 3 commits' '
269
git bisect start $HASH4 $HASH1 &&
270
git bisect skip &&
271
test_expect_code 2 git bisect skip >my_bisect_log.txt &&
272
- grep "first bad commit could be any of" my_bisect_log.txt &&
272
+ grep "first '\''bad'\'' commit could be any of" my_bisect_log.txt &&
273
! grep $HASH1 my_bisect_log.txt &&
274
grep $HASH2 my_bisect_log.txt &&
275
grep $HASH3 my_bisect_log.txt &&
@@ -285,7 +285,7 @@ test_expect_success 'bisect skip: cannot tell between 2 commits' '
285
git bisect start $HASH4 $HASH1 &&
286
git bisect skip &&
287
test_expect_code 2 git bisect good >my_bisect_log.txt &&
288
- grep "first bad commit could be any of" my_bisect_log.txt &&
288
+ grep "first '\''bad'\'' commit could be any of" my_bisect_log.txt &&
289
! grep $HASH1 my_bisect_log.txt &&
290
! grep $HASH2 my_bisect_log.txt &&
291
grep $HASH3 my_bisect_log.txt &&
@@ -304,7 +304,7 @@ test_expect_success 'bisect skip: with commit both bad and skipped' '
304
git bisect good $HASH1 &&
305
git bisect skip &&
306
test_expect_code 2 git bisect good >my_bisect_log.txt &&
307
- grep "first bad commit could be any of" my_bisect_log.txt &&
307
+ grep "first '\''bad'\'' commit could be any of" my_bisect_log.txt &&
308
! grep $HASH1 my_bisect_log.txt &&
309
! grep $HASH2 my_bisect_log.txt &&
310
grep $HASH3 my_bisect_log.txt &&
@@ -348,8 +348,8 @@ test_expect_success 'git bisect run: args, stdout and stderr with no arguments'
348
test_bisect_run_args <<-'EOF_ARGS' 6<<-EOF_OUT 7<<-'EOF_ERR'
349
EOF_ARGS
350
running './run.sh'
351
- $HASH4 is the first bad commit
352
- bisect found first bad commit
351
+ $HASH4 is the first 'bad' commit
352
+ bisect found first 'bad' commit
353
EOF_OUT
354
EOF_ERR
355
"
@@ -359,8 +359,8 @@ test_expect_success 'git bisect run: args, stdout and stderr: "--" argument' "
359
<-->
360
EOF_ARGS
361
running './run.sh' '--'
362
- $HASH4 is the first bad commit
363
- bisect found first bad commit
362
+ $HASH4 is the first 'bad' commit
363
+ bisect found first 'bad' commit
364
EOF_OUT
365
EOF_ERR
366
"
@@ -373,8 +373,8 @@ test_expect_success 'git bisect run: args, stdout and stderr: "--log foo --no-lo
373
<bar>
374
EOF_ARGS
375
running './run.sh' '--log' 'foo' '--no-log' 'bar'
376
- $HASH4 is the first bad commit
377
- bisect found first bad commit
376
+ $HASH4 is the first 'bad' commit
377
+ bisect found first 'bad' commit
378
EOF_OUT
379
EOF_ERR
380
"
@@ -384,8 +384,8 @@ test_expect_success 'git bisect run: args, stdout and stderr: "--bisect-start" a
384
<--bisect-start>
385
EOF_ARGS
386
running './run.sh' '--bisect-start'
387
- $HASH4 is the first bad commit
388
- bisect found first bad commit
387
+ $HASH4 is the first 'bad' commit
388
+ bisect found first 'bad' commit
389
EOF_OUT
390
EOF_ERR
391
"
@@ -418,7 +418,7 @@ test_expect_success 'git bisect run: unable to verify on good' "
418
fi
419
EOF
420
cat <<-'EOF' >expect &&
421
- unable to verify './fail.sh' on good revision
421
+ unable to verify './fail.sh' on 'good' revision
422
EOF
423
test_when_finished 'git bisect reset' &&
424
git bisect start &&
@@ -439,7 +439,7 @@ test_expect_success '"git bisect run" simple case' '
439
git bisect good $HASH1 &&
440
git bisect bad $HASH4 &&
441
git bisect run ./test_script.sh >my_bisect_log.txt &&
442
- grep "$HASH3 is the first bad commit" my_bisect_log.txt &&
442
+ grep "$HASH3 is the first '\''bad'\'' commit" my_bisect_log.txt &&
443
git bisect reset
444
'
445
@@ -461,7 +461,7 @@ test_expect_success '"git bisect run" with more complex "git bisect start"' '
461
EOF
462
git bisect start $HASH4 $HASH1 &&
463
git bisect run ./test_script.sh >my_bisect_log.txt &&
464
- grep "$HASH4 is the first bad commit" my_bisect_log.txt &&
464
+ grep "$HASH4 is the first '\''bad'\'' commit" my_bisect_log.txt &&
465
git bisect reset
466
'
467
@@ -474,7 +474,7 @@ test_expect_success 'bisect run accepts exit code 126 as bad' '
474
git bisect good $HASH1 &&
475
git bisect bad $HASH4 &&
476
git bisect run ./test_script.sh >my_bisect_log.txt &&
477
- grep "$HASH3 is the first bad commit" my_bisect_log.txt
477
+ grep "$HASH3 is the first '\''bad'\'' commit" my_bisect_log.txt
478
'
479
480
test_expect_success POSIXPERM 'bisect run fails with non-executable test script' '
@@ -485,7 +485,7 @@ test_expect_success POSIXPERM 'bisect run fails with non-executable test script'
485
git bisect good $HASH1 &&
486
git bisect bad $HASH4 &&
487
test_must_fail git bisect run ./not-executable.sh >my_bisect_log.txt &&
488
- ! grep "is the first bad commit" my_bisect_log.txt
488
+ ! grep "is the first '\''bad'\'' commit" my_bisect_log.txt
489
'
490
491
test_expect_success 'bisect run accepts exit code 127 as bad' '
@@ -497,7 +497,7 @@ test_expect_success 'bisect run accepts exit code 127 as bad' '
497
git bisect good $HASH1 &&
498
git bisect bad $HASH4 &&
499
git bisect run ./test_script.sh >my_bisect_log.txt &&
500
- grep "$HASH3 is the first bad commit" my_bisect_log.txt
500
+ grep "$HASH3 is the first '\''bad'\'' commit" my_bisect_log.txt
501
'
502
503
test_expect_success 'bisect run fails with missing test script' '
@@ -507,7 +507,7 @@ test_expect_success 'bisect run fails with missing test script' '
507
git bisect good $HASH1 &&
508
git bisect bad $HASH4 &&
509
test_must_fail git bisect run ./does-not-exist.sh >my_bisect_log.txt &&
510
- ! grep "is the first bad commit" my_bisect_log.txt
510
+ ! grep "is the first '\''bad'\'' commit" my_bisect_log.txt
511
'
512
513
# $HASH1 is good, $HASH5 is bad, we skip $HASH3
@@ -520,14 +520,14 @@ test_expect_success 'bisect skip: add line and then a new test' '
520
git bisect start $HASH5 $HASH1 &&
521
git bisect skip &&
522
git bisect good > my_bisect_log.txt &&
523
- grep "$HASH5 is the first bad commit" my_bisect_log.txt &&
523
+ grep "$HASH5 is the first '\''bad'\'' commit" my_bisect_log.txt &&
524
git bisect log > log_to_replay.txt &&
525
git bisect reset
526
'
527
528
test_expect_success 'bisect skip and bisect replay' '
529
git bisect replay log_to_replay.txt > my_bisect_log.txt &&
530
- grep "$HASH5 is the first bad commit" my_bisect_log.txt &&
530
+ grep "$HASH5 is the first '\''bad'\'' commit" my_bisect_log.txt &&
531
git bisect reset
532
'
533
@@ -541,7 +541,7 @@ test_expect_success 'bisect run & skip: cannot tell between 2' '
541
EOF
542
git bisect start $HASH6 $HASH1 &&
543
test_expect_code 2 git bisect run ./test_script.sh >my_bisect_log.txt &&
544
- grep "first bad commit could be any of" my_bisect_log.txt &&
544
+ grep "first '\''bad'\'' commit could be any of" my_bisect_log.txt &&
545
! grep $HASH3 my_bisect_log.txt &&
546
! grep $HASH6 my_bisect_log.txt &&
547
grep $HASH4 my_bisect_log.txt &&
@@ -560,7 +560,7 @@ test_expect_success 'bisect run & skip: find first bad' '
560
EOF
561
git bisect start $HASH7 $HASH1 &&
562
git bisect run ./test_script.sh >my_bisect_log.txt &&
563
- grep "$HASH6 is the first bad commit" my_bisect_log.txt
563
+ grep "$HASH6 is the first '\''bad'\'' commit" my_bisect_log.txt
564
'
565
566
test_expect_success 'bisect skip only one range' '
@@ -569,7 +569,7 @@ test_expect_success 'bisect skip only one range' '
569
git bisect skip $HASH1..$HASH5 &&
570
test "$HASH6" = "$(git rev-parse --verify HEAD)" &&
571
test_must_fail git bisect bad > my_bisect_log.txt &&
572
- grep "first bad commit could be any of" my_bisect_log.txt
572
+ grep "first '\''bad'\'' commit could be any of" my_bisect_log.txt
573
'
574
575
test_expect_success 'bisect skip many ranges' '
@@ -578,7 +578,7 @@ test_expect_success 'bisect skip many ranges' '
578
git bisect skip $HASH2 $HASH2.. ..$HASH5 &&
579
test "$HASH6" = "$(git rev-parse --verify HEAD)" &&
580
test_must_fail git bisect bad > my_bisect_log.txt &&
581
- grep "first bad commit could be any of" my_bisect_log.txt
581
+ grep "first '\''bad'\'' commit could be any of" my_bisect_log.txt
582
'
583
584
test_expect_success 'bisect starting with a detached HEAD' '
@@ -594,7 +594,7 @@ test_expect_success 'bisect starting with a detached HEAD' '
594
test_expect_success 'bisect errors out if bad and good are mistaken' '
595
git bisect reset &&
596
test_must_fail git bisect start $HASH2 $HASH4 2> rev_list_error &&
597
- test_grep "mistook good and bad" rev_list_error &&
597
+ test_grep "mistook '\''good'\'' and '\''bad'\''" rev_list_error &&
598
git bisect reset
599
'
600
@@ -610,7 +610,7 @@ test_expect_success 'bisect does not create a "bisect" branch' '
610
rev_hash6=$(git rev-parse --verify HEAD) &&
611
test "$rev_hash6" = "$HASH6" &&
612
git bisect good > my_bisect_log.txt &&
613
- grep "$HASH7 is the first bad commit" my_bisect_log.txt &&
613
+ grep "$HASH7 is the first '\''bad'\'' commit" my_bisect_log.txt &&
614
git bisect reset &&
615
rev_hash6=$(git rev-parse --verify bisect) &&
616
test "$rev_hash6" = "$HASH6" &&
@@ -703,7 +703,7 @@ test_expect_success '"git bisect run --first-parent" simple case' '
703
git bisect good $HASH4 &&
704
git bisect bad $B_HASH &&
705
git bisect run ./test_script.sh >my_bisect_log.txt &&
706
- grep "$B_HASH is the first bad commit" my_bisect_log.txt &&
706
+ grep "$B_HASH is the first '\''bad'\'' commit" my_bisect_log.txt &&
707
git bisect reset &&
708
test_path_is_missing .git/BISECT_FIRST_PARENT
709
'
@@ -777,7 +777,7 @@ test_expect_success 'restricting bisection on one dir' '
777
para1=$(git rev-parse --verify HEAD) &&
778
test "$para1" = "$PARA_HASH1" &&
779
git bisect bad > my_bisect_log.txt &&
780
- grep "$PARA_HASH1 is the first bad commit" my_bisect_log.txt
780
+ grep "$PARA_HASH1 is the first '\''bad'\'' commit" my_bisect_log.txt
781
'
782
783
test_expect_success 'restricting bisection on one dir and a file' '
@@ -795,7 +795,7 @@ test_expect_success 'restricting bisection on one dir and a file' '
795
para1=$(git rev-parse --verify HEAD) &&
796
test "$para1" = "$PARA_HASH1" &&
797
git bisect good > my_bisect_log.txt &&
798
- grep "$PARA_HASH4 is the first bad commit" my_bisect_log.txt
798
+ grep "$PARA_HASH4 is the first '\''bad'\'' commit" my_bisect_log.txt
799
'
800
801
test_expect_success 'skipping away from skipped commit' '
@@ -826,7 +826,7 @@ test_expect_success 'test bisection on bare repo - --no-checkout specified' '
826
"test \$(git rev-list BISECT_HEAD ^$HASH2 --max-count=1 | wc -l) = 0" \
827
>../nocheckout.log
828
) &&
829
- grep "$HASH3 is the first bad commit" nocheckout.log
829
+ grep "$HASH3 is the first '\''bad'\'' commit" nocheckout.log
830
'
831
832
@@ -841,7 +841,7 @@ test_expect_success 'test bisection on bare repo - --no-checkout defaulted' '
841
"test \$(git rev-list BISECT_HEAD ^$HASH2 --max-count=1 | wc -l) = 0" \
842
>../defaulted.log
843
) &&
844
- grep "$HASH3 is the first bad commit" defaulted.log
844
+ grep "$HASH3 is the first '\''bad'\'' commit" defaulted.log
845
'
846
847
#
@@ -969,7 +969,7 @@ cat > expected.bisect-log <<EOF
969
git bisect start '$HASH4' '$HASH2'
970
# good: [$HASH3] Add <3: Another new day for git> into <hello>.
971
git bisect good $HASH3
972
-# first bad commit: [$HASH4] Add <4: Ciao for now> into <hello>.
972
+# first 'bad' commit: [$HASH4] Add <4: Ciao for now> into <hello>.
973
EOF
974
975
test_expect_success 'bisect log: successful result' '
@@ -988,8 +988,8 @@ git bisect start '$HASH4' '$HASH2'
988
# skip: [$HASH3] Add <3: Another new day for git> into <hello>.
989
git bisect skip $HASH3
990
# only skipped commits left to test
991
-# possible first bad commit: [$HASH4] Add <4: Ciao for now> into <hello>.
992
-# possible first bad commit: [$HASH3] Add <3: Another new day for git> into <hello>.
991
+# possible first 'bad' commit: [$HASH4] Add <4: Ciao for now> into <hello>.
992
+# possible first 'bad' commit: [$HASH3] Add <3: Another new day for git> into <hello>.
993
EOF
994
995
test_expect_success 'bisect log: only skip commits left' '
@@ -1031,21 +1031,21 @@ test_expect_success 'bisect start with one new and old' '
1031
git bisect new $HASH4 &&
1032
git bisect new &&
1033
git bisect new >bisect_result &&
1034
- grep "$HASH2 is the first new commit" bisect_result &&
1034
+ grep "$HASH2 is the first '\''new'\'' commit" bisect_result &&
1035
git bisect log >log_to_replay.txt &&
1036
git bisect reset
1037
'
1038
1039
test_expect_success 'bisect replay with old and new' '
1040
git bisect replay log_to_replay.txt >bisect_result &&
1041
- grep "$HASH2 is the first new commit" bisect_result &&
1041
+ grep "$HASH2 is the first '\''new'\'' commit" bisect_result &&
1042
git bisect reset
1043
'
1044
1045
test_expect_success 'bisect replay with CRLF log' '
1046
append_cr <log_to_replay.txt >log_to_replay_crlf.txt &&
1047
git bisect replay log_to_replay_crlf.txt >bisect_result_crlf &&
1048
- grep "$HASH2 is the first new commit" bisect_result_crlf &&
1048
+ grep "$HASH2 is the first '\''new'\'' commit" bisect_result_crlf &&
1049
git bisect reset
1050
'
1051
@@ -1078,13 +1078,13 @@ test_expect_success 'bisect terms shows good/bad after start' '
1078
test_expect_success 'bisect start with one term1 and term2' '
1079
git bisect reset &&
1080
git bisect start --term-old term2 --term-new term1 >bisect_result &&
1081
- grep "status: waiting for both term2 and term1 commits" bisect_result &&
1081
+ test_grep "status: waiting for both '\''term2'\'' and '\''term1'\'' commits" bisect_result &&
1082
git bisect term2 $HASH1 >bisect_result &&
1083
- grep "status: waiting for term1 commit, 1 term2 commit known" bisect_result &&
1083
+ test_grep "status: waiting for '\''term1'\'' commit, 1 '\''term2'\'' commit known" bisect_result &&
1084
git bisect term1 $HASH4 &&
1085
git bisect term1 &&
1086
git bisect term1 >bisect_result &&
1087
- grep "$HASH2 is the first term1 commit" bisect_result &&
1087
+ test_grep "$HASH2 is the first '\''term1'\'' commit" bisect_result &&
1088
git bisect log >log_to_replay.txt &&
1089
git bisect reset
1090
'
@@ -1101,7 +1101,7 @@ test_expect_success 'bogus command does not start bisect' '
1101
1102
test_expect_success 'bisect replay with term1 and term2' '
1103
git bisect replay log_to_replay.txt >bisect_result &&
1104
- grep "$HASH2 is the first term1 commit" bisect_result &&
1104
+ grep "$HASH2 is the first '\''term1'\'' commit" bisect_result &&
1105
git bisect reset
1106
'
1107
@@ -1110,7 +1110,7 @@ test_expect_success 'bisect run term1 term2' '
1110
git bisect start --term-new term1 --term-old term2 $HASH4 $HASH1 &&
1111
git bisect term1 &&
1112
git bisect run false >bisect_result &&
1113
- grep "bisect found first term1 commit" bisect_result &&
1113
+ test_grep "bisect found first '\''term1'\'' commit" bisect_result &&
1114
git bisect log >log_to_replay.txt &&
1115
git bisect reset
1116
'
@@ -1120,7 +1120,7 @@ test_expect_success 'bisect start term1 term2' '
1120
git bisect start --term-new term1 --term-old term2 $HASH4 $HASH1 &&
1121
git bisect term1 &&
1122
git bisect term1 >bisect_result &&
1123
- grep "$HASH2 is the first term1 commit" bisect_result &&
1123
+ grep "$HASH2 is the first '\''term1'\'' commit" bisect_result &&
1124
git bisect log >log_to_replay.txt &&
1125
git bisect reset
1126
'
@@ -1154,8 +1154,8 @@ test_expect_success 'bisect start --term-* does store terms' '
1154
git bisect start --term-bad=one --term-good=two &&
1155
git bisect terms >actual &&
1156
cat <<-EOF >expected &&
1157
- Your current terms are two for the old state
1158
- and one for the new state.
1157
+ Your current terms are '\''two'\'' for the old state
1158
+ and '\''one'\'' for the new state.
1159
EOF
1160
test_cmp expected actual &&
1161
git bisect terms --term-bad >actual &&
@@ -1212,7 +1212,7 @@ test_expect_success 'bisect handles annotated tags' '
1212
git bisect good tag-one &&
1213
git bisect bad tag-two >output &&
1214
bad=$(git rev-parse --verify tag-two^{commit}) &&
1215
- grep "$bad is the first bad commit" output
1215
+ grep "$bad is the first '\''bad'\'' commit" output
1216
'
1217
1218
test_expect_success 'bisect run fails with exit code equals or greater than 128' '
@@ -1236,29 +1236,29 @@ test_expect_success 'bisect visualize with a filename with dash and space' '
1236
test_expect_success 'bisect state output with multiple good commits' '
1237
git bisect reset &&
1238
git bisect start >output &&
1239
- grep "waiting for both good and bad commits" output &&
1239
+ grep "waiting for both '\''good'\'' and '\''bad'\'' commits" output &&
1240
git bisect log >output &&
1241
- grep "waiting for both good and bad commits" output &&
1241
+ grep "waiting for both '\''good'\'' and '\''bad'\'' commits" output &&
1242
git bisect good "$HASH1" >output &&
1243
- grep "waiting for bad commit, 1 good commit known" output &&
1243
+ grep "waiting for '\''bad'\'' commit, 1 '\''good'\'' commit known" output &&
1244
git bisect log >output &&
1245
- grep "waiting for bad commit, 1 good commit known" output &&
1245
+ grep "waiting for '\''bad'\'' commit, 1 '\''good'\'' commit known" output &&
1246
git bisect good "$HASH2" >output &&
1247
- grep "waiting for bad commit, 2 good commits known" output &&
1247
+ grep "waiting for '\''bad'\'' commit, 2 '\''good'\'' commits known" output &&
1248
git bisect log >output &&
1249
- grep "waiting for bad commit, 2 good commits known" output
1249
+ grep "waiting for '\''bad'\'' commit, 2 '\''good'\'' commits known" output
1250
'
1251
1252
test_expect_success 'bisect state output with bad commit' '
1253
git bisect reset &&
1254
git bisect start >output &&
1255
- grep "waiting for both good and bad commits" output &&
1255
+ grep "waiting for both '\''good'\'' and '\''bad'\'' commits" output &&
1256
git bisect log >output &&
1257
- grep "waiting for both good and bad commits" output &&
1257
+ grep "waiting for both '\''good'\'' and '\''bad'\'' commits" output &&
1258
git bisect bad "$HASH4" >output &&
1259
- grep -F "waiting for good commit(s), bad commit known" output &&
1259
+ grep -F "waiting for '\''good'\'' commit(s), '\''bad'\'' commit known" output &&
1260
git bisect log >output &&
1261
- grep -F "waiting for good commit(s), bad commit known" output
1261
+ grep -F "waiting for '\''good'\'' commit(s), '\''bad'\'' commit known" output
1262
'
1263
1264
test_expect_success 'verify correct error message' '