From: "Zbigniew Jędrzejewski-Szmek" <zbyszek@in.waw.pl>
To: git@vger.kernel.org, gitster@pobox.com
Cc: pclouds@gmail.com, j.sixt@viscovery.net,
"Zbigniew Jędrzejewski-Szmek" <zbyszek@in.waw.pl>
Subject: [PATCH v7a 5/9] merge --stat: use the full terminal width
Date: Thu, 1 Mar 2012 13:26:42 +0100 [thread overview]
Message-ID: <1330604806-30288-5-git-send-email-zbyszek@in.waw.pl> (raw)
In-Reply-To: <1330604806-30288-1-git-send-email-zbyszek@in.waw.pl>
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>
---
builtin/merge.c | 1 +
t/t4052-stat-output.sh | 8 ++++----
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/builtin/merge.c b/builtin/merge.c
index b4fbc60..b1cd90c 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -399,6 +399,7 @@ static void finish(struct commit *head_commit,
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 f81d427..954c16f 100755
--- a/t/t4052-stat-output.sh
+++ b/t/t4052-stat-output.sh
@@ -168,9 +168,9 @@ respects expect200 log -1 --stat
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
@@ -178,9 +178,9 @@ test_expect_success 'merge --stat ignores COLUMNS (big change)' '
'
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
--
1.7.9.2.399.gdf4d.dirty
next prev parent reply other threads:[~2012-03-01 12:29 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-28 6:53 Incremental updates to What's cooking Junio C Hamano
2012-02-29 7:37 ` Zbigniew Jędrzejewski-Szmek
2012-02-29 8:39 ` Junio C Hamano
2012-02-29 13:50 ` Zbigniew Jędrzejewski-Szmek
2012-02-29 19:28 ` Junio C Hamano
2012-02-29 20:19 ` Zbigniew Jędrzejewski-Szmek
2012-02-29 20:48 ` Junio C Hamano
2012-03-01 12:26 ` [PATCH v7a 1/9] diff --stat: tests for long filenames and big change counts Zbigniew Jędrzejewski-Szmek
2012-03-01 12:26 ` [PATCH v7a 2/9] diff --stat: use the full terminal width Zbigniew Jędrzejewski-Szmek
2012-03-01 12:26 ` [PATCH v7a 3/9] show " Zbigniew Jędrzejewski-Szmek
2012-03-01 12:26 ` [PATCH v7a 4/9] log " Zbigniew Jędrzejewski-Szmek
2012-03-01 12:26 ` Zbigniew Jędrzejewski-Szmek [this message]
2012-03-01 12:26 ` [PATCH v7a 6/9] diff --stat: use a maximum of 5/8 for the filename part Zbigniew Jędrzejewski-Szmek
2012-03-01 17:18 ` Junio C Hamano
2012-03-26 23:45 ` Jeff King
2012-03-27 5:10 ` [PATCH] t4052: unset $COLUMNS inherited from environment Zbigniew Jędrzejewski-Szmek
2012-03-27 5:17 ` Jeff King
2012-03-27 6:22 ` [PATCH v2] tests: unset COLUMNS " Zbigniew Jędrzejewski-Szmek
2012-03-27 18:44 ` Jeff King
2012-03-27 5:32 ` [PATCH] t4052: unset $COLUMNS " Johannes Sixt
2012-03-01 12:26 ` [PATCH v7a 7/9] diff --stat: add a test for output with COLUMNS=40 Zbigniew Jędrzejewski-Szmek
2012-03-01 12:26 ` [PATCH v7a 8/9] diff --stat: enable limiting of the graph part Zbigniew Jędrzejewski-Szmek
2012-03-01 12:26 ` [PATCH v7a 9/9] diff --stat: add config option to limit graph width Zbigniew Jędrzejewski-Szmek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1330604806-30288-5-git-send-email-zbyszek@in.waw.pl \
--to=zbyszek@in.waw.pl \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=j.sixt@viscovery.net \
--cc=pclouds@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).