Thread (13 messages) flat view 13 messages, 3 authors, 2016-06-15

Re: [PATCH 3/6 rebase-version] diff.c: Output the text graph padding before each diff line.

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:48:51

Bo Yang [off-list ref] writes:
quoted hunk ↗ jump to hunk
Change -p/--dirstat/--binary/--numstat/--stat/--shortstat/
--check/--summary to align with graph paddings.
Thanks Jeff King [off-list ref] for reporting the '--summary' bug and his
initial patch.

Signed-off-by: Bo Yang <redacted>
---
 diff.c |  201 +++++++++++++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 148 insertions(+), 53 deletions(-)
diff --git a/diff.c b/diff.c
index e2f910a..b99a56c 100644
--- a/diff.c
+++ b/diff.c
...
@@ -1289,10 +1329,20 @@ struct dirstat_dir {
 	int alloc, nr, percent, cumulative;
 };
 
-static long gather_dirstat(FILE *file, struct dirstat_dir *dir, unsigned long changed, const char *base, int baselen)
+static long gather_dirstat(struct diff_options *opt, struct dirstat_dir *dir,
+		unsigned long changed, const char *base, int baselen)
 {
 	unsigned long this_dir = 0;
 	unsigned int sources = 0;
+	assert(opt);
+	FILE *file = opt->file;
+	const char *line_prefix = "";
+	struct strbuf *msg = NULL;
Yikes.  Do we really need that assert?  Also "FILE *file" is used
only once and it would be easier to read without an extra variable.
Besides, this introduces decl-after-statement error.

Other than that the series looked clean.  Oh, please drop the final "."
from all of your "Subject:"s.

Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help