format-patch: keep cover-letter diffstat wrapped in 72 columns

We already wrap shortlog around 72 columns in cover letters. Do the same
for diffstat (also in cover letters).

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Nguyễn Thái Ngọc Duy 2018-01-25 18:59:26 +07:00 committed by Junio C Hamano
parent 5be1f00a9a
commit 43662b23ab

View File

@ -29,6 +29,8 @@
#include "gpg-interface.h" #include "gpg-interface.h"
#include "progress.h" #include "progress.h"
#define MAIL_DEFAULT_WRAP 72
/* Set a default date-time format for git log ("log.date" config variable) */ /* Set a default date-time format for git log ("log.date" config variable) */
static const char *default_date_mode = NULL; static const char *default_date_mode = NULL;
@ -1044,7 +1046,7 @@ static void make_cover_letter(struct rev_info *rev, int use_stdout,
shortlog_init(&log); shortlog_init(&log);
log.wrap_lines = 1; log.wrap_lines = 1;
log.wrap = 72; log.wrap = MAIL_DEFAULT_WRAP;
log.in1 = 2; log.in1 = 2;
log.in2 = 4; log.in2 = 4;
log.file = rev->diffopt.file; log.file = rev->diffopt.file;
@ -1061,6 +1063,7 @@ static void make_cover_letter(struct rev_info *rev, int use_stdout,
memcpy(&opts, &rev->diffopt, sizeof(opts)); memcpy(&opts, &rev->diffopt, sizeof(opts));
opts.output_format = DIFF_FORMAT_SUMMARY | DIFF_FORMAT_DIFFSTAT; opts.output_format = DIFF_FORMAT_SUMMARY | DIFF_FORMAT_DIFFSTAT;
opts.stat_width = MAIL_DEFAULT_WRAP;
diff_setup_done(&opts); diff_setup_done(&opts);