Thread (14 messages) flat view 14 messages, 2 authors, 2016-06-15

Re: [PATCH 3/4] diff --stat: use the real terminal width

From: Nguyen Thai Ngoc Duy <hidden>
Date: 2016-06-15 22:53:02

2012/2/10 Zbigniew Jędrzejewski-Szmek [off-list ref]:
quoted hunk ↗ jump to hunk
@@ -1341,7 +1342,7 @@ static void show_stats(struct diffstat_t *data, struct diff_options *options)
               line_prefix = msg->buf;
       }

-       width = options->stat_width ? options->stat_width : 80;
+       width = options->stat_width ? options->stat_width : term_columns();
       name_width = options->stat_name_width ? options->stat_name_width : 50;
       count = options->stat_count ? options->stat_count : data->nr;
I tried this in the past and "git log -p" looked ugly on git.git
mainly because commit messages are still ~70 char long lines on my 279
char wide terminal. If this is project dependent, perhaps a config
key? Also the "50" below the changed line, maybe you want to change it
to 0.6 * width.
-- 
Duy
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help