Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-02-21 23:45:04 +0300
committerJunio C Hamano <gitster@pobox.com>2018-02-21 23:45:04 +0300
commite469e9c5c6919a2325db8bbef2d7f7d3640df524 (patch)
treef3ee3f351ec774f5af8ef39b91945d4d9f1f9527 /builtin
parenta4ee44448fe98dcd8f1db9e43729ac67fc80e031 (diff)
parent071dd0ba43b51a2124f3f9884283cd68a9506323 (diff)
Merge branch 'nd/format-patch-stat-width'
"git format-patch" learned to give 72-cols to diffstat, which is consistent with other line length limits the subcommand uses for its output meant for e-mails. * nd/format-patch-stat-width: format-patch: reduce patch diffstat width to 72 format-patch: keep cover-letter diffstat wrapped in 72 columns
Diffstat (limited to 'builtin')
-rw-r--r--builtin/log.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/builtin/log.c b/builtin/log.c
index 46b4ca13e5..94ee177d56 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -29,6 +29,8 @@
#include "gpg-interface.h"
#include "progress.h"
+#define MAIL_DEFAULT_WRAP 72
+
/* Set a default date-time format for git log ("log.date" config variable) */
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);
log.wrap_lines = 1;
- log.wrap = 72;
+ log.wrap = MAIL_DEFAULT_WRAP;
log.in1 = 2;
log.in2 = 4;
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));
opts.output_format = DIFF_FORMAT_SUMMARY | DIFF_FORMAT_DIFFSTAT;
+ opts.stat_width = MAIL_DEFAULT_WRAP;
diff_setup_done(&opts);
@@ -1614,6 +1617,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
(!rev.diffopt.output_format ||
rev.diffopt.output_format == DIFF_FORMAT_PATCH))
rev.diffopt.output_format = DIFF_FORMAT_DIFFSTAT | DIFF_FORMAT_SUMMARY;
+ if (!rev.diffopt.stat_width)
+ rev.diffopt.stat_width = MAIL_DEFAULT_WRAP;
/* Always generate a patch */
rev.diffopt.output_format |= DIFF_FORMAT_PATCH;