summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 87b5054)
raw | patch | inline | side by side (parent: 87b5054)
author | Junio C Hamano <gitster@pobox.com> | |
Thu, 22 Sep 2011 17:54:47 +0000 (10:54 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 22 Sep 2011 17:54:47 +0000 (10:54 -0700) |
"git diff -p" piped to external diffstat and "git diff --stat" may see
different patch text (both are valid and describe the same change
correctly) when counting the number of added and deleted lines, arriving
at different results to confuse the users, as --stat/--numstat codepath
always uses the hardcoded -U0 as the context length.
Make --stat/--numstat codepath to honor the context length the same way
as the textual patch codepath does to avoid this problem.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
different patch text (both are valid and describe the same change
correctly) when counting the number of added and deleted lines, arriving
at different results to confuse the users, as --stat/--numstat codepath
always uses the hardcoded -U0 as the context length.
Make --stat/--numstat codepath to honor the context length the same way
as the textual patch codepath does to avoid this problem.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff.c | patch | blob | history |
index 9a5c77c13ff3406a85e8a94f309a639529f2d88b..d442c66e961a614280b2a49f23d4cf89a878c0e2 100644 (file)
--- a/diff.c
+++ b/diff.c
memset(&xpp, 0, sizeof(xpp));
memset(&xecfg, 0, sizeof(xecfg));
xpp.flags = o->xdl_opts;
+ xecfg.ctxlen = o->context;
+ xecfg.interhunkctxlen = o->interhunkcontext;
xdi_diff_outf(&mf1, &mf2, diffstat_consume, diffstat,
&xpp, &xecfg);
}