Skip to content

Commit 8479232

Browse files
rscharfegitster
authored andcommitted
commit, sequencer: turn off break_opt for commit summary
dc6b1d9 (wt-status: use settings from git_diff_ui_config, 2018-05-04) disabled diffopt.break_opt for diffstats shown by git status and in commit templates. For git status there isn't even a way to enable it. Make the commit summary (shown after the commit) consistent by disabling it there as well. Reported-by: Laurent Lyaudet <[email protected]> Signed-off-by: René Scharfe <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4c53a8c commit 8479232

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

sequencer.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1328,7 +1328,6 @@ void print_commit_summary(struct repository *r,
13281328
get_commit_format(format.buf, &rev);
13291329
rev.always_show_header = 0;
13301330
rev.diffopt.detect_rename = DIFF_DETECT_RENAME;
1331-
rev.diffopt.break_opt = 0;
13321331
diff_setup_done(&rev.diffopt);
13331332

13341333
refs = get_main_ref_store(the_repository);

t/t7524-commit-summary.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/sh
2+
3+
test_description='git commit summary'
4+
. ./test-lib.sh
5+
6+
test_expect_success 'setup' '
7+
test_seq 101 200 >file &&
8+
git add file &&
9+
git commit -m initial &&
10+
git tag initial
11+
'
12+
13+
test_expect_success 'commit summary ignores rewrites' '
14+
git reset --hard initial &&
15+
test_seq 200 300 >file &&
16+
17+
git diff --stat >diffstat &&
18+
git diff --stat --break-rewrites >diffstatrewrite &&
19+
20+
# make sure this scenario is a detectable rewrite
21+
! test_cmp_bin diffstat diffstatrewrite &&
22+
23+
git add file &&
24+
git commit -m second >actual &&
25+
26+
grep "1 file" <actual >actual.total &&
27+
grep "1 file" <diffstat >diffstat.total &&
28+
test_cmp diffstat.total actual.total
29+
'
30+
31+
test_done

0 commit comments

Comments
 (0)