Skip to content

Commit 7a7159a

Browse files
keszybzgitster
authored andcommitted
merge --stat: use the full terminal width
Make merge --stat behave like diff --stat and use the full terminal width. Signed-off-by: Zbigniew Jędrzejewski-Szmek <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5e0ec15 commit 7a7159a

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

builtin/merge.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,7 @@ static void finish(struct commit *head_commit,
399399
if (new_head && show_diffstat) {
400400
struct diff_options opts;
401401
diff_setup(&opts);
402+
opts.stat_width = -1; /* use full terminal width */
402403
opts.output_format |=
403404
DIFF_FORMAT_SUMMARY | DIFF_FORMAT_DIFFSTAT;
404405
opts.detect_rename = DIFF_DETECT_RENAME;

t/t4052-stat-output.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,19 +168,19 @@ respects expect200 log -1 --stat
168168
EOF
169169

170170
cat >expect <<'EOF'
171-
abcd | 1000 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
171+
abcd | 1000 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
172172
EOF
173-
test_expect_success 'merge --stat ignores COLUMNS (big change)' '
173+
test_expect_success 'merge --stat respects COLUMNS (big change)' '
174174
git checkout -b branch HEAD^^ &&
175175
COLUMNS=100 git merge --stat --no-ff master^ >output &&
176176
grep " | " output >actual
177177
test_cmp expect actual
178178
'
179179

180180
cat >expect <<'EOF'
181-
...aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 1000 ++++++++++++++++++++
181+
...aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 1000 ++++++++++++++++++++++++++++++++++++++++
182182
EOF
183-
test_expect_success 'merge --stat ignores COLUMNS (long filename)' '
183+
test_expect_success 'merge --stat respects COLUMNS (long filename)' '
184184
COLUMNS=100 git merge --stat --no-ff master >output &&
185185
grep " | " output >actual
186186
test_cmp expect actual

0 commit comments

Comments
 (0)