summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2012-03-01 12:26:43 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-03-01 17:14:58 (GMT)
commit1b058bc30df5f79fe7449cacd8ae7128944327f7 (patch)
treec07f24cd05a790beb104c86ea90b8cd401a45dae /t
parent7a7159ace6c93ea6c55086dfc7ba7533a3e3c07d (diff)
downloadgit-1b058bc30df5f79fe7449cacd8ae7128944327f7.zip
git-1b058bc30df5f79fe7449cacd8ae7128944327f7.tar.gz
git-1b058bc30df5f79fe7449cacd8ae7128944327f7.tar.bz2
diff --stat: use a maximum of 5/8 for the filename part
The way that available columns are divided between the filename part and the graph part is modified to use as many columns as necessary for the filenames and the rest for the graph. If there isn't enough columns to print both the filename and the graph, at least 5/8 of available space is devoted to filenames. On a standard 80 column terminal, or if not connected to a terminal and using the default of 80 columns, this gives the same partition as before. The effect of this change is visible in the patch to the test vector in t4052; with a small change with long filename, it stops truncating the name part too short, and also allocates a bit more columns to the graph for larger changes. Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t4052-stat-output.sh16
1 files changed, 8 insertions, 8 deletions
diff --git a/t/t4052-stat-output.sh b/t/t4052-stat-output.sh
index 954c16f..d0ed0dc 100755
--- a/t/t4052-stat-output.sh
+++ b/t/t4052-stat-output.sh
@@ -22,18 +22,18 @@ test_expect_success 'preparation' '
while read cmd args
do
cat >expect <<-'EOF'
- ...aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 1 +
+ ...aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 1 +
EOF
- test_expect_success "$cmd: a short graph bar does not extend to the full width" '
+ test_expect_success "$cmd: small change with long name gives more space to the name" '
git $cmd $args >output &&
grep " | " output >actual &&
test_cmp expect actual
'
cat >expect <<-'EOF'
- ...aaaaaaaaaaaaaaaaaaaaaa | 1 +
+ ...aaaaaaaaaaaaaaaaaaaaaaaaaa | 1 +
EOF
- test_expect_success "$cmd --stat=width: name is chopped to leave room to the right of a short bar" '
+ test_expect_success "$cmd --stat=width: a long name is given more room when the bar is short" '
git $cmd $args --stat=40 >output &&
grep " | " output >actual &&
test_cmp expect actual
@@ -131,11 +131,11 @@ test_expect_success 'preparation for long filename tests' '
'
cat >expect <<'EOF'
- ...aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 1000 +++++
+ ...aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 1000 ++++++++++++
EOF
while read cmd args
do
- test_expect_success "$cmd --stat=width with big change and long name favors name part" '
+ test_expect_success "$cmd --stat=width with big change is more balanced" '
git $cmd $args --stat-width=60 >output &&
grep " | " output >actual &&
test_cmp expect actual
@@ -151,7 +151,7 @@ cat >expect80 <<'EOF'
...aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 1000 ++++++++++++++++++++
EOF
cat >expect200 <<'EOF'
- ...aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 1000 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 1000 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
EOF
while read verb expect cmd args
do
@@ -178,7 +178,7 @@ test_expect_success 'merge --stat respects COLUMNS (big change)' '
'
cat >expect <<'EOF'
- ...aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 1000 ++++++++++++++++++++++++++++++++++++++++
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | 1000 +++++++++++++++++++++++++++++++++++++++
EOF
test_expect_success 'merge --stat respects COLUMNS (long filename)' '
COLUMNS=100 git merge --stat --no-ff master >output &&