git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] format-patch: respect --stat when explicitly specified

From
LLLeif Lindholm <leif.lindholm@linaro.org>
Date
Nov 6, 2018, 10:48 UTC
Message-ID
<20181106104811.14625-1-leif.lindholm@linaro.org>

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
Next: Duy Nguyen
Message 1 of 10 in “format-patch: respect --stat when explicitly specified”
  1. format-patch: respect --stat when explicitly specifiedLeif Lindholm, Nov 6, 2018
  2. Duy NguyenNov 6, 2018
  3. Laszlo ErsekNov 6, 2018
  4. Duy NguyenNov 6, 2018
  5. Leif LindholmNov 6, 2018
  6. Duy NguyenNov 6, 2018
  7. Leif LindholmNov 6, 2018
  8. Duy NguyenNov 6, 2018
  9. format-patch: respect --stat in cover letter's diffstatNguyễn Thái Ngọc Duy, Nov 7, 2018
  10. Laszlo ErsekNov 7, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.