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

[PATCH 2/5] diff: do not duplicate shortstat with "git diff --stat --shortstat"

From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date
Jan 16, 2012, 04:47 UTC
Message-ID
<1326689281-23788-3-git-send-email-pclouds@gmail.com>
In-Reply-To
<1326689281-23788-1-git-send-email-pclouds@gmail.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 diff.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/diff.c b/diff.c
index d4223e2..203b054 100644
--- a/diff.c
+++ b/diff.c
@@ -1465,10 +1465,6 @@ static void show_stats(struct diffstat_t *data, struct diff_options *options)
 			fprintf(options->file, "%s ...\n", line_prefix);
 		extra_shown = 1;
 	}
-	fprintf(options->file, "%s", line_prefix);
-	fprintf(options->file,
-	       " %d files changed, %d insertions(+), %d deletions(-)\n",
-	       total_files, adds, dels);
 }
 
 static void show_shortstats(struct diffstat_t *data, struct diff_options *options)
@@ -4218,6 +4214,9 @@ void diff_flush(struct diff_options *options)
 	if (output_format & DIFF_FORMAT_DIRSTAT && DIFF_OPT_TST(options, DIRSTAT_BY_LINE))
 		dirstat_by_line = 1;
 
+	if (output_format & DIFF_FORMAT_DIFFSTAT)
+		output_format |= DIFF_FORMAT_SHORTSTAT;
+
 	if (output_format & (DIFF_FORMAT_DIFFSTAT|DIFF_FORMAT_SHORTSTAT|DIFF_FORMAT_NUMSTAT) ||
 	    dirstat_by_line) {
 		struct diffstat_t diffstat;
-- 
1.7.3.1.256.g2539c.dirty
Previous: Nguyễn Thái Ngọc DuyNext: Nguyễn Thái Ngọc Duy
Message 3 of 6 in “Dynamic diff summary for merge/pull”
  1. 0/5 Dynamic diff summary for merge/pullNguyễn Thái Ngọc Duy, Jan 16, 2012
  2. 1/5 diff: add space around "="Nguyễn Thái Ngọc Duy, Jan 16, 2012
  3. 2/5 diff: do not duplicate shortstat with "git diff --stat --shortstat"Nguyễn Thái Ngọc Duy, Jan 16, 2012
  4. 3/5 diff: buffer dirstat outputNguyễn Thái Ngọc Duy, Jan 16, 2012
  5. 4/5 diff: add --dynstatNguyễn Thái Ngọc Duy, Jan 16, 2012
  6. 5/5 merge: support setting merge.[diff]stat to dynstatNguyễn Thái Ngọc Duy, Jan 16, 2012

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.