git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Leif Lindholm <leif.lindholm@linaro.org>
To: git@vger.kernel.org
Cc: "Laszlo Ersek" <lersek@redhat.com>,
	"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>,
	"Junio C Hamano" <gitster@pobox.com>
Subject: [PATCH] format-patch: respect --stat when explicitly specified
Date: Tue,  6 Nov 2018 10:48:11 +0000	[thread overview]
Message-ID: <20181106104811.14625-1-leif.lindholm@linaro.org> (raw)

Commit 43662b23abbd
("format-patch: keep cover-letter diffstat wrapped in 72 columns") made
format-patch keep the diffstat to within 72 characters. However, it does
this even when --stat is explicitly set on the command line.

Make it possible to explicitly override the new mechanism, using --stat,
matching the functionality before this change. This also matches the
output in the case of non-cover-letter files.

Cc: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>
Reported-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
---

Note:
In TianoCore we have LotsOfGloriousFilesNamedInReallyLongCamelCase, so
our official submission guidelines specify the use of --stat.

 builtin/log.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/builtin/log.c b/builtin/log.c
index 061d4fd86..07e6ae2c1 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -1009,7 +1009,8 @@ static void show_diffstat(struct rev_info *rev,
 
 	memcpy(&opts, &rev->diffopt, sizeof(opts));
 	opts.output_format = DIFF_FORMAT_SUMMARY | DIFF_FORMAT_DIFFSTAT;
-	opts.stat_width = MAIL_DEFAULT_WRAP;
+	if (rev->diffopt.stat_width == -1)
+		opts.stat_width = MAIL_DEFAULT_WRAP;
 
 	diff_setup_done(&opts);
 
-- 
2.11.0


             reply	other threads:[~2018-11-06 10:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-06 10:48 Leif Lindholm [this message]
2018-11-06 15:56 ` [PATCH] format-patch: respect --stat when explicitly specified Duy Nguyen
2018-11-06 16:17   ` Laszlo Ersek
2018-11-06 16:20     ` Duy Nguyen
2018-11-06 16:31   ` Leif Lindholm
2018-11-06 17:13     ` Duy Nguyen
2018-11-06 17:25       ` Leif Lindholm
2018-11-06 17:27         ` Duy Nguyen
2018-11-07 16:49 ` [PATCH v2] format-patch: respect --stat in cover letter's diffstat Nguyễn Thái Ngọc Duy
2018-11-07 22:21   ` Laszlo Ersek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181106104811.14625-1-leif.lindholm@linaro.org \
    --to=leif.lindholm@linaro.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=lersek@redhat.com \
    --cc=pclouds@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).