Re: [PATCH 3/4] diff --stat: use the real terminal width
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Feb 10, 2012, 06:15 UTC
- Message-ID
- <CACsJy8APGeTNv_E3qD=xFCiLC25M_nm3aJbq6YU73J=X0Wxh2w@mail.gmail.com>
- In-Reply-To
- <1328831921-27272-4-git-send-email-zbyszek@in.waw.pl>
2012/2/10 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>:
Show 8 quoted lines
> @@ -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