threads / patch / 4262

patch--summary output should print immediately after stats.

Subject: [PATCH] --summary output should print immediately after stats.

## tl;dr

One message between May 23, 2006 and May 23, 2006. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Sean· May 23, 2006, 09:34 UTC · lore

Currently the summary is displayed after the patch. Fix this so that the output order is stat-summary-patch. As a consequence of the way this is coded, the --summary option will only actually display summary data if combined with either the --stat or --patch-with-stat option.

Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca>
---
3060faeb9c9320e12895cb33d25edb4aa4ba072e
 diff.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
3060faeb9c9320e12895cb33d25edb4aa4ba072e
Show changes to diff.c +4 −1
diff --git a/diff.c b/diff.c
index e16e0bf..fa36366 100644
--- a/diff.c
+++ b/diff.c
@@ -1867,6 +1867,9 @@ void diff_flush(struct diff_options *opt
 		show_stats(diffstat);
 		free(diffstat);
 		diffstat = NULL;
+		if (options->summary)
+			for (i = 0; i < q->nr; i++)
+				diff_summary(q->queue[i]);
 		putchar(options->line_termination);
 	}
 	for (i = 0; i < q->nr; i++) {
@@ -1880,7 +1883,7 @@ void diff_flush(struct diff_options *opt
 	}
 
 	for (i = 0; i < q->nr; i++) {
-		if (options->summary)
+		if (diffstat && options->summary)
 			diff_summary(q->queue[i]);
 		diff_free_filepair(q->queue[i]);
 	}
-- 
1.3.GIT

← back to recent threads