summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5e0ec15)
raw | patch | inline | side by side (parent: 5e0ec15)
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | |
Thu, 1 Mar 2012 12:26:42 +0000 (13:26 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 1 Mar 2012 17:14:16 +0000 (09:14 -0800) |
Make merge --stat behave like diff --stat and use the full terminal
width.
Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
width.
Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/merge.c | patch | blob | history | |
t/t4052-stat-output.sh | patch | blob | history |
diff --git a/builtin/merge.c b/builtin/merge.c
index b4fbc60e6d25157ed022ebd3f2bc8a2aeb774b0c..b1cd90ccc39d224d57129172da9a9c650e627df7 100644 (file)
--- a/builtin/merge.c
+++ b/builtin/merge.c
if (new_head && show_diffstat) {
struct diff_options opts;
diff_setup(&opts);
+ opts.stat_width = -1; /* use full terminal width */
opts.output_format |=
DIFF_FORMAT_SUMMARY | DIFF_FORMAT_DIFFSTAT;
opts.detect_rename = DIFF_DETECT_RENAME;
diff --git a/t/t4052-stat-output.sh b/t/t4052-stat-output.sh
index f81d427db554354585f9b244e1b1115e094777b5..954c16f0acf8e190cc968911cef59ebf586c607f 100755 (executable)
--- a/t/t4052-stat-output.sh
+++ b/t/t4052-stat-output.sh
EOF
cat >expect <<'EOF'
- abcd | 1000 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ abcd | 1000 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
EOF
-test_expect_success 'merge --stat ignores COLUMNS (big change)' '
+test_expect_success 'merge --stat respects COLUMNS (big change)' '
git checkout -b branch HEAD^^ &&
COLUMNS=100 git merge --stat --no-ff master^ >output &&
grep " | " output >actual
'
cat >expect <<'EOF'
- ...aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 1000 ++++++++++++++++++++
+ ...aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 1000 ++++++++++++++++++++++++++++++++++++++++
EOF
-test_expect_success 'merge --stat ignores COLUMNS (long filename)' '
+test_expect_success 'merge --stat respects COLUMNS (long filename)' '
COLUMNS=100 git merge --stat --no-ff master >output &&
grep " | " output >actual
test_cmp expect actual