Skip to content

Commit 1b8f4dc

Browse files
committed
Merge branch 'jk/bisect-final-output'
The final report from "git bisect" used to show the suspected culprit using a raw "diff-tree", with which there is no output for a merge commit. This has been updated to use a more modern and human readable output that still is concise enough. * jk/bisect-final-output: bisect: make diff-tree output prettier bisect: fix internal diff-tree config loading bisect: use string arguments to feed internal diff-tree
2 parents 3cef676 + b02be8b commit 1b8f4dc

File tree

2 files changed

+8
-17
lines changed

2 files changed

+8
-17
lines changed

bisect.c

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -896,24 +896,15 @@ static void show_diff_tree(struct repository *r,
896896
const char *prefix,
897897
struct commit *commit)
898898
{
899+
const char *argv[] = {
900+
"diff-tree", "--pretty", "--stat", "--summary", "--cc", NULL
901+
};
899902
struct rev_info opt;
900903

901-
/* diff-tree init */
904+
git_config(git_diff_ui_config, NULL);
902905
repo_init_revisions(r, &opt, prefix);
903-
git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
904-
opt.abbrev = 0;
905-
opt.diff = 1;
906906

907-
/* This is what "--pretty" does */
908-
opt.verbose_header = 1;
909-
opt.use_terminator = 0;
910-
opt.commit_format = CMIT_FMT_DEFAULT;
911-
912-
/* diff-tree init */
913-
if (!opt.diffopt.output_format)
914-
opt.diffopt.output_format = DIFF_FORMAT_RAW;
915-
916-
setup_revisions(0, NULL, &opt, NULL);
907+
setup_revisions(ARRAY_SIZE(argv) - 1, argv, &opt, NULL);
917908
log_tree_commit(&opt, commit);
918909
}
919910

t/t6030-bisect-porcelain.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ test_expect_success 'bisect: --no-checkout - target in breakage' '
681681
check_same BROKEN_HASH6 BISECT_HEAD &&
682682
git bisect bad BISECT_HEAD &&
683683
check_same BROKEN_HASH5 BISECT_HEAD &&
684-
git bisect good BISECT_HEAD &&
684+
test_must_fail git bisect good BISECT_HEAD &&
685685
check_same BROKEN_HASH6 bisect/bad &&
686686
git bisect reset
687687
'
@@ -692,7 +692,7 @@ test_expect_success 'bisect: --no-checkout - target after breakage' '
692692
check_same BROKEN_HASH6 BISECT_HEAD &&
693693
git bisect good BISECT_HEAD &&
694694
check_same BROKEN_HASH8 BISECT_HEAD &&
695-
git bisect good BISECT_HEAD &&
695+
test_must_fail git bisect good BISECT_HEAD &&
696696
check_same BROKEN_HASH9 bisect/bad &&
697697
git bisect reset
698698
'
@@ -701,7 +701,7 @@ test_expect_success 'bisect: demonstrate identification of damage boundary' "
701701
git bisect reset &&
702702
git checkout broken &&
703703
git bisect start broken master --no-checkout &&
704-
git bisect run \"\$SHELL_PATH\" -c '
704+
test_must_fail git bisect run \"\$SHELL_PATH\" -c '
705705
GOOD=\$(git for-each-ref \"--format=%(objectname)\" refs/bisect/good-*) &&
706706
git rev-list --objects BISECT_HEAD --not \$GOOD >tmp.\$\$ &&
707707
git pack-objects --stdout >/dev/null < tmp.\$\$

0 commit comments

Comments
 (0)