show --stat: use the full terminal width
Make show --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>
Zbigniew Jędrzejewski-Szmek committed
Mar 1, 2012 at 13:26 UTC
666c92a229de10f8bbfc33cf6f92aad8733f0002
2 files changed
+4
-2
builtin/log.c
+2
@@ -447,6 +447,8 @@ int cmd_show(int argc, const char **argv, const char *prefix)
447
rev.diff = 1;
448
rev.always_show_header = 1;
449
rev.no_walk = 1;
450
+ rev.diffopt.stat_width = -1; /* Scale to real terminal size */
451
+
452
memset(&opt, 0, sizeof(opt));
453
opt.def = "HEAD";
454
opt.tweak = show_rev_tweak_rev;
t/t4052-stat-output.sh
+2
-2
@@ -97,7 +97,7 @@ do
97
done <<\EOF
98
ignores expect80 format-patch -1 --stdout
99
respects expect200 diff HEAD^ HEAD --stat
100
-ignores expect80 show --stat
100
+respects expect200 show --stat
101
ignores expect80 log -1 --stat
102
EOF
103
@@ -163,7 +163,7 @@ do
163
done <<\EOF
164
ignores expect80 format-patch -1 --stdout
165
respects expect200 diff HEAD^ HEAD --stat
166
-ignores expect80 show --stat
166
+respects expect200 show --stat
167
ignores expect80 log -1 --stat
168
EOF
169